I want to know how to insert info from a combo box in a form into diferent fields in a table.
If i have a 3 column combo box in my form and i want to fill 3 different fields in the table from the same combo box, how do i?
I think the syntax below would work, assuming that fields being posted are one numeric data type and two text data types. Replace the object(table, field, form, combo) names used with the actual names in your application. Also use the actual data types.
Dim intField1Data As Integer
Dim strField2Data As String
Dim strField3Data As String
Dim strSql As String
intField1Data = Forms!YourForm!YourCombo.Column(0).Value
strField2Data = Forms!YourForm!YourCombo.Column(1).Value
strField3Data = Forms!YourForm!YourCombo.Column(2).Value
strSql = "INSERT INTO [YourTable] ([Field1], [Field2],[Field3]) VALUES (intField1Data, strField2Data, strField3Data)";
CurrentDb.Execute strSql