Hi
I have a form called Invoice that has a subform called Invoice_datasheet. The subform has the field Customer as the child link and Customer_Name in the Invoice form (The master) as the master link which means I have 2 tables as well.
since my Invoice field is opened by a command button from another form, it is filtered out so that only one customer's invoices are shown at a time.
On the other hand, I have a searchbox in the form Invoice to look up any Invoice ID for any customer and it has the following vb code:
If Not IsNull(Forms![Invoice]![searchbox]) Then
Me.Filter = ""
Dim rs As Object
Dim strLinkValue As String
strLinkValue = Me![searchbox].Value
Set rs = Me.RecordsetClone
rs.FindFirst "[Invoice ID]=" & strLinkValue & ""
Forms!Invoice.Bookmark = rs.Bookmark
End If
The searchbox works perfectly but I want to create two buttons (Previous and Next) that cycle through the Invoices for the current customer. The two buttons work perfectly if the filter is on, but after I use the searchbox to look up an InvoiceID, the filter gets cleared out so those two buttons will cycle through all the invoices and not just through the invoices for the current customer.
How can I fix this? Is there any way to apply a filter so only current customer's invoices will be cycled?
Any help will be greatly appreciated and sorry for the long post