hi guys
so i'm getting an run-time error 13, type mismatch, error message.
I have a command button that is supposed to delete the selected record in a listbox based on the activityID(autonum).
when the command button is clicked this is the code being run:
Dim db As Database
Dim rs As Recordset
Dim strSQL As String
If Me.lstCurrentlyBooked.ItemsSelected.Count > 0 Then
Set db = CurrentDb()
strSQL = "SELECT * FROM [ActivitiesBooked] WHERE [ActivityID] = " & Me.lstCurrentlyBooked.Column(0) & " ; "
MsgBox strSQL
Set rs = db.OpenRecordset(strSQL)
rs.Delete
rs.Close
Set rs = Nothing
End If
Me.lstCurrentlyBooked.Requery
is bombs on set rs = db.openrecordset(strSQL)
the correct values is coming across. ex. activityid = 55
any suggestions would be great.
thanks
Jeremy
so i'm getting an run-time error 13, type mismatch, error message.
I have a command button that is supposed to delete the selected record in a listbox based on the activityID(autonum).
when the command button is clicked this is the code being run:
Dim db As Database
Dim rs As Recordset
Dim strSQL As String
If Me.lstCurrentlyBooked.ItemsSelected.Count > 0 Then
Set db = CurrentDb()
strSQL = "SELECT * FROM [ActivitiesBooked] WHERE [ActivityID] = " & Me.lstCurrentlyBooked.Column(0) & " ; "
MsgBox strSQL
Set rs = db.OpenRecordset(strSQL)
rs.Delete
rs.Close
Set rs = Nothing
End If
Me.lstCurrentlyBooked.Requery
is bombs on set rs = db.openrecordset(strSQL)
the correct values is coming across. ex. activityid = 55
any suggestions would be great.
thanks
Jeremy