I have a database that checks out and in equipment. On my form I have two combo boxes, one for "Check Out" items and one for "Check In" items. For some reason when we navigate away from one of the buttons and go to the other one to check something back in that is already back in we are just cleaning up the database to show it back in, it throws us a visual basic error message. Picture attached.
Stops on "DoCmd.RunSQL strSQL"
I have tried it with trying to insert the: If IsNull(Me.cmbCheckOut) Then
and still get the error message.
I would like to be able to navigate away from that combo box and return to it later if necessary. Could some one assist?
Private Sub cmbCheckOut_AfterUpdate()
' Purpose: To add a record to tEquipment_Detail to reflect a check-out.
' Runs when the 'Check Out an Item:' combo box is updated.
Dim strSQL As String
' Disable the cautionary messages.
' This is the SQL statement that adds a record to tEquipment_Detail with
' the appropriate information.
If IsNull(Me.cmbCheckOut) Then
strSQL = "INSERT INTO tEquipment_Detail (ItemID,OutEID,TimeStampOut,TransID) " & _
"VALUES (" & Me.cmbCheckOut & ", " & Me.EID & ", #" & Now() & "#, 1)"
' Run the SQL command.
' Requery refreshes the information shown on the form
' These two update the data in the drop-down views.
' Enable the cautionary messages.