Hi heres a code June 7 helped me with a couple of months back but i,ve been asked to do some changes
The cboBranch was a text box unbound with Row Source a value list.
The BranchNameID (was Depot) was also row source from a value list.
Now the ComboBox is
Control Source BranchNameID
Row Source tblBranch
Row source Type Table Query
tblBranch is only two fields ID and BranchName and BranchNameID is the foreign key in the main table
The report works all OK from a command button to show all records but obviously I'm now comparing the Text in the cbo with a number from the ID and it is not going to happen. I'm trying all sorts to get the bound column right. but to no avail
I thought Me.cboBranch.Column(1) might do the trick
been playing around in the properties for way to long now
Private Sub cmdFilter_Click()
Dim strWhere
If Not IsNull(Me.cboBranch) Then
strWhere = strWhere & "[BranchNameID]='" & Me.cboBranch & "'"
End If
If Not IsNull(Me.txtStartDate) Then
strWhere = strWhere & IIf(strWhere = "", "", " AND ") & "[date_inc] Between #" & Me.txtStartDate & "# AND #" & Me.txtEndDate & "#"
End If
DoCmd.OpenReport "rptIncListing", acViewPreview, , strWhere
End Sub
Thanking you in advance