I need a button that saves the contents of 2 ComboBoxes on a new Table and everytime this Button is pressed a new line on the Table is created with new contents saved...
The Code you sent me was very usefull.. thanx.
But now I have a new problem. I created a new column on my table to show Time/Date. So I need you to tell me how do I save Time/Date everytime the button is pressed???
Use the Now() function. I assume col3 is the datetime column in the following example.
Sub cmdInsert_Click()
Dim sSQL As String
sSQL = "Insert Into Table1 "
sSQL = sSQL & "(col1, col2, col3) Values ('"
sSQL = sSQL & me.combobox1 & "','"
sSQL = sSQL & me.combobox2 & "',"
sSQL = sSQL & Now() & ""
DoCmd.SetWarnings False
DoCmd.RunSQL sSQL
DoCmd.SetWarnings True
End Sub
Terry L. Broadbent Life would be easier if I had the source code. -Anonymous
One last question: I need to compare the value selected in the ComboBox with the ones saved on the table. If the value is already on the table, a number 1 one is added by its side(on a new row), if not, the value is saved....
I don't know how to compare values in a ComboBox with the ones saved on a Table...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.