Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

update a table from a listbox with SQL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Baffee - 18 Jan 2006 20:02 GMT
On my form (Frm:BillingWorksheetMultiples) I have 2 listboxes.  
The first listbox (list1) has as it's rowsource:

SELECT dbo_Clients.ID, dbo_Clients.Cltnum, dbo_Clients.CltEng,
dbo_Clients.CltnameFROM dbo_Clients ORDER BY dbo_Clients.Cltnum,
dbo_Clients.CltEng;

The other listbox (list2) has it's rowsource:

SELECT TempClient.CltID, TempClient.Cltnum, TempClient.CltEng,
TempClient.ClientName FROM TempClient;

The second list box comes from an empty, temporary table.  

I want to create an "ON CLICK" event that takes the info in list 1 and
copies it into list 2.  I then will add a button to the form that runs a
report based on the clients that were added to this temporary table.  

I tried using:
DoCmd.RunSQL "Insert into TempClient ( CltID,Cltnum, CltEng,CltName )WHERE
(((dbo_Clients.ID)=[Forms]![Frm:BillingWorksheetMultiples]![List1]))"

I get a snytax error for INSERT INTO.  

Can you help me??

Thanks!
Dave - 18 Jan 2006 21:42 GMT
If you're using the list box to select multiple entries, check out Allen
Browne's web site for tips on constucting the SQL statement you need.

http://allenbrowne.com/ser-50.html

Hope this helps.
Dave

> On my form (Frm:BillingWorksheetMultiples) I have 2 listboxes.  
> The first listbox (list1) has as it's rowsource:
[quoted text clipped - 23 lines]
>
> Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.