Hi Folks,
I need some help. I have a form with a combo box bound to Table 2. I am trying to write an Insert Into Statement that will add the value to Table 1(Account Number Dump) in the On Change event. I keep getting Error '3134' Syntax Error in Insert Into Statement. Can anyone tell me what I'm doing wrong?
Private Sub Account_Number_Change()
Dim strSQL As String
If Me.Account_Number = DLookup("[Budget Account]", "Account Number Dump", "[Manager] = '" & Me.Manager & "'") Then
Else
strSQL = "INSERT INTO [Account Number Dump] (Manager, Budget Account) Values ('" & Me.Manager & "', '" & Me.Account_Number & "');"
Debug.Print strSQL
CurrentDb.Execute strSQL
End If
End Sub
My debug gives me:
INSERT INTO [Account Number Dump] (Manager, Budget Account) Values ('Randall', '30-638-5540');
I need some help. I have a form with a combo box bound to Table 2. I am trying to write an Insert Into Statement that will add the value to Table 1(Account Number Dump) in the On Change event. I keep getting Error '3134' Syntax Error in Insert Into Statement. Can anyone tell me what I'm doing wrong?

Private Sub Account_Number_Change()
Dim strSQL As String
If Me.Account_Number = DLookup("[Budget Account]", "Account Number Dump", "[Manager] = '" & Me.Manager & "'") Then
Else
strSQL = "INSERT INTO [Account Number Dump] (Manager, Budget Account) Values ('" & Me.Manager & "', '" & Me.Account_Number & "');"
Debug.Print strSQL
CurrentDb.Execute strSQL
End If
End Sub
My debug gives me:
INSERT INTO [Account Number Dump] (Manager, Budget Account) Values ('Randall', '30-638-5540');