var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Problem with data filter on form with combo
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")
myInt = [Forms]![Main Form]![cboCustomer]
Me.Filter = "MainTable.[Customer ID] = 'myInt'"
Me.FilterOn = True
You should change that line this one:
Originally Posted by dbase
Me.Filter = "MainTable.[Customer ID] =" & CStr(myInt)
You have to convert myInt variable to string with CStr() function before use it with the filter.
Me.Filter = "MainTable.[Customer ID] = '" & myInt & "'"
Thank you very much for your reply.
I will try it out and let you know.