Problem with filtering records on form

Mansoor Ahmad

Registered User.
Local time
Today, 21:12
Joined
Jan 20, 2003
Messages
140
Dear All

I want to filter records at the click of a button on my form based on the selection I make in an unbound combo box placed on same form.

I am using following codes. Can someone please let me know where I am doing wrong.

Private Sub Command22_Click()
'Filter data for CustomerID
Dim myInt As String
If IsNull(Forms![Main Form]![cboCustomer]) Then
DisplayMessage ("Please select Customer first")

Else
myInt = [Forms]![Main Form]![cboCustomer]
Me.Filter = "MainTable.[Customer ID] = 'myInt'"
Me.FilterOn = True
End If
End Sub

Thanks
 

Users who are viewing this thread

Back
Top Bottom