Hi,
im using an add button in a form to add new users...
im using the following code:
But the problem is sometimes it adds, sometime it doesnt......
i dont understand why?
it wont add at all sometimes
im using an add button in a form to add new users...
im using the following code:
Code:
Private Sub addrec_Click()
Dim strSQL As String
DoCmd.SetWarnings False
Dim strmsg
strmsg = "Are you sure you want to add " & username & " to the table?"
If MsgBox(strmsg, vbYesNo) = vbYes Then
strSQL = "INSERT INTO tab_main ([username], [cost_centre], [number], [phone_model], [imei], [puk_code], [sim_no], [date_issued], [notes], [tariff], [call_int], [roam]) VALUES ('" & Me.username & "','" & Me.cost_centre & "','" & Me.number & "','" & Me.phone_model & "','" & Me.imei & "','" & Me.puk_code & "','" & Me.sim_no & "',#" & Me.date_issued & "#,'" & Me.notes & "','" & Me.tariff & "'," & Me.call_int & "," & Me.roam & ")"
''Debug.Print strSQL
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
End If
End Sub
i dont understand why?
it wont add at all sometimes
Comment