Hello,
I seem to be a little crazy right now and cant figure out what is going on in my code that is messing everything up.
I'm trying to open a recordset and pull a value in a text column based on the value in a numeric column and I'm getting "error#3464 Data type mismatch in criteria expression."
Here's my code:
Thank you in advance.
I seem to be a little crazy right now and cant figure out what is going on in my code that is messing everything up.
I'm trying to open a recordset and pull a value in a text column based on the value in a numeric column and I'm getting "error#3464 Data type mismatch in criteria expression."
Here's my code:
Private Sub xProductTreeview_Click()
'On Error GoTo Error_Handler
Dim db As dao.Database
Dim rst As dao.Recordset
Dim nodSelected As MSComctlLib.Node
Dim stOpenForm As String
Set db = CurrentDb
Set nodSelected = Me.xProductTreeview.SelectedItem
If Mid(nodSelected.Key, 1, 1) = "C" Then
Set rst = db.OpenRecordset("SELECT MenuItemForm FROM tblMainMenu WHERE [MenuItemID] = '1'")
'rst.MoveLast
MsgBox rst
Else
MsgBox Mid(nodSelected.Key, 6, 7)
End If
'Error_Handler:
'MsgBox "An error has occured. Please record the following error number and message" & vbNewLine & _
'"so that it can be provided to technical support." & vbNewLine & _
'"Error # " & Err.Number & vbNewLine & _
'"Error Message " & Err.Description
End Sub
Thank you in advance.