I have a main form with Customer Info, and a subform with invoices.. they are
linked with the custID.
I would like a 'goto invoice' text box.. This would when cmdGoTo is clicked
take the value of the text box, search the subforms InvoiceID field and show
this record, AND update so the customer info record is correct on the main
form. Is there any easy way of doing this? If i was to just perform a search
on a subform, will it still update the main form on a requery? hmm help! any
ideas
R.
Evi - 01 May 2008 20:47 GMT
I couldn't see the reply to this. It seems to have got missed.
Finding a record in the subform should not be a problem. See if you can see
where to put your own form, subform and control names in the code below
Dim frm as Form
Dim MyInvoice As Long
'assumes InvoiceID is a number field
If Not IsNull(Me.NameOfYourTextBox) Then
MyInvoice = Me.NameOfYourTextBox
Set frm = Forms!NameOfMainForm.NameOfSubform.Form
frm.RecordsetClone.FindFirst "[InvoiceID]=" & MyInvoice
frm.Bookmark = frm.RecordsetClone.Bookmark
'goes to record in subform
End if
But the next bit didn't make sense
"AND update so the customer info record is correct on the main form"
Update what?
Evi
> I have a main form with Customer Info, and a subform with invoices.. they are
> linked with the custID.
[quoted text clipped - 7 lines]
>
> R.