spartansFC
Programmer
Hi
The main set up of the database is:
MainForm: frmCustomers, tblCustomers, lngPeopleID (PK)
Subform1: frmCustomersBookings Subform, tblBookings, lngBookingID (PK), lngPeopleID(FK)
Subform2: frmCustomerslInvoices Subform, tblInvoices, lngInvoiceID (PK), lngBookingID (FK)
I've got 3 search combo boxes on the main form to search for either the customer name, booking number or invoice number, i'm stuck on the invoice number search.
I got the customer search to work via:
RowSource: SELECT tblCustomers.lngPeopleID, [strForename] & " " & [strSurname] AS staffname FROM tblCustomers ORDER BY [strForename] & " " & [strSurname];
I got the booking search to work via
Row Source: SELECT tblBookings.lngPeopleID, tblBookings.lngBookingID, tblBookings.strReferenceNumber FROM tblBookings ORDER BY tblBookings.strReferenceNumber;
In the combo box i'm using to search for invoices, i have:
cmbInvoiceSearch
RowSource: SELECT tblInvoices.lngBookingID, tblInvoices.lngInvoiceID, tblInvoices.strInvoiceNo FROM tblInvoices ORDER BY tblInvoices.strInvoiceNo;
BoundColumn: 1
Coloumn Widths: 0;0;2.54
The AfterUpdate has
i even tried
Nothing happens when i select any invoice number from the combo box, i managed to get the other two working using the same method but i don't think i'm referencing the control of the subform properly.
Any ideas
Michael
The main set up of the database is:
MainForm: frmCustomers, tblCustomers, lngPeopleID (PK)
Subform1: frmCustomersBookings Subform, tblBookings, lngBookingID (PK), lngPeopleID(FK)
Subform2: frmCustomerslInvoices Subform, tblInvoices, lngInvoiceID (PK), lngBookingID (FK)
I've got 3 search combo boxes on the main form to search for either the customer name, booking number or invoice number, i'm stuck on the invoice number search.
I got the customer search to work via:
RowSource: SELECT tblCustomers.lngPeopleID, [strForename] & " " & [strSurname] AS staffname FROM tblCustomers ORDER BY [strForename] & " " & [strSurname];
Code:
rs.FindFirst "[lngPeopleID] = " & Str(Nz(Me![cmbCustomerSearch], 0))
I got the booking search to work via
Row Source: SELECT tblBookings.lngPeopleID, tblBookings.lngBookingID, tblBookings.strReferenceNumber FROM tblBookings ORDER BY tblBookings.strReferenceNumber;
Code:
rs.FindFirst "[lngPeopleID] = " & Str(Nz(Me![cmbBookingSearch], 0))
In the combo box i'm using to search for invoices, i have:
cmbInvoiceSearch
RowSource: SELECT tblInvoices.lngBookingID, tblInvoices.lngInvoiceID, tblInvoices.strInvoiceNo FROM tblInvoices ORDER BY tblInvoices.strInvoiceNo;
BoundColumn: 1
Coloumn Widths: 0;0;2.54
The AfterUpdate has
Code:
Private Sub cmbInvoiceSearch_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "Forms.[frmCustomers]![frmCustomersBookings Subform].[frmCustomerslInvoices Subform].Form![lngBookingID]" = " & Str(Nz(Me![cmbInvoiceSearch], 0))"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
i even tried
Code:
rs.FindFirst "Forms![frmCustomers]![frmCustomersBookings Subform].Form![frmCustomerslInvoices Subform].Form.[lngBookingID]" = " & Str(Nz(Me![cmbInvoiceSearch], 0))"
Nothing happens when i select any invoice number from the combo box, i managed to get the other two working using the same method but i don't think i'm referencing the control of the subform properly.
Any ideas
Michael