HI, I'm new to SQL and VBA and trying some basic things out using Access 2003. I am trying to have text boxes that are filled in, then assigned as variables and then trying to use them in an INSERT INTO statement:
Code:
Dim strSQL As String
Dim NumAss As String
Dim SimAss As String
Dim ImeiAss As String
Dim stDocName As String
SimAss = SimBox.Value
ImeiAss = ImeiBox.Value
NumAss = NumBox.Value
strSQL = "INSERT INTO Phone ([Number], [SIM Number], [IMEI Number]) VALUES (' " & NumAss & " ," & SimAss & ", " & ImeiAss & " ')"
DoCmd.RunSQL (strSQL)
This version errors saying that the number of query values and destination fields are not the same, I ahve tried it countless times with different brackets and quotation marks in different places with no joy!
Hopefully someone can point me in the right direction please!