I have a VBA code that is initiated when I hit the Process button on my form. It is supposed to update 4 fields and previously worked. I haven't revisited the form or the table that is supposed to be updated in a few weeks, and now it doesn't seem to want to work. The entire code is below, and the debugger jumps to "dbs.Execute strSQL, dbFailOnError".
Thank you in advance for your help.
Private Sub Process_Click()
Dim X
If IsNull(Me!Sender) Then ErrMsg: Exit Sub
If IsNull(Me!Recipient) Then ErrMsg: Exit Sub
If IsNull(Me!SeqNo) Then ErrMsg: Exit Sub
If IsNull(Me!IssueDate) Then ErrMsg: Exit Sub
Dim dbs As Database
Set dbs = CurrentDb
strSQL = "INSERT INTO TransNo "
strSQL = strSQL & " (Sender,Recipient,SeqNo,IssueDate) "
strSQL = strSQL & " VALUES('" & Me.Sender & "', '" & Me.Recipient & "', '" & Me.SeqNo & ", '" & Me.IssueDate & ");"
dbs.Execute strSQL, dbFailOnError
Set dbs = Nothing
DoCmd.OpenQuery "UpdateTransNo"
Exit Sub
ErrHandler:
MsgBox (Err.Description)
rst.Close
Set dbs = Nothing
Exit Sub
End Sub