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 / Forms / November 2007

Tip: Looking for answers? Try searching our database.

Data from a form populating a table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
carrie - 30 Nov 2007 14:55 GMT
I have a form set-up with combo boxes from multiple tables.  Once all of the
data is entered into the form I would like to press a button and have the
information from the form export into a separate table.  Example: from a
combo box the person could choose the origin city (from a city table), choose
the origin state (from a state table), enter in a dollar amount (in a text
box).  Once they have entered the information the user could click on a
button and have the data go into a different table.  Does this make sense?  
Can someone tell me how to make this work?  Appreciate any help that I can
get.
Thanks
Carl Rapson - 30 Nov 2007 15:36 GMT
>I have a form set-up with combo boxes from multiple tables.  Once all of
>the
[quoted text clipped - 8 lines]
> get.
> Thanks

In the Click event of the button perform an INSERT action. Build the INSERT
statement by concatenating your values from the combo and text boxes.
Something like:

Dim strSQL As String
strSQL = "INSERT INTO [table] (field1,field2,field3...)"
strSQL = strSQL & " VALUES (" & cboBox1 & "," & cboBox2 & "," & txtBox3 &
")"
CurrentDb.Execute strSQL

You will need to watch for things like Null values in fields, because you
can't concatenate a Null value onto a string. Also, if your values are text
instead of numeric, you'll need to be sure to put quotes around the values
when you concatenate them.

Carl Rapson
 
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.