G
Guest
Hello everyone,
I need help again. The main form uses a record source where the PK is
FranchiseID. The subform has a record source that includes a field for
invoice numbers [cffcInvoiceNum]. I want the user to enter an invoice number
into a textbox, click the command button and have the main form switch to the
FranchiseID that matches the invoice number's FranchiseID. (I hope that's
clear...)
The Variant is capturing the correct FranchiseID, but the main form is not
moving to that record. I'm not using "Me" in this 'cause I figured with the
code being in a subform "Me" might mean the subform. Here's what I have so
far that's not working:
Dim rs As Object
Dim varFranID As Variant
If Me.txtFindInv <> Null Then
varFranID = DLookup("[FranchiseID]", "tblcffcMatSales",
"[cffcInvoiceNum] = " _
& Forms!frmFranchise!sfrmCffcMatSales.Form!txtFindInv)
Set rs = Forms!frmFranchise.RecordsetClone
rs.FindFirst "[FranchiseID] = " & Str(Nz(varFranID, 0))
If Not rs.EOF Then Forms!frmFranchise.Bookmark = rs.Bookmark
End If
Any help and guidance is appreciated.
tia!
I need help again. The main form uses a record source where the PK is
FranchiseID. The subform has a record source that includes a field for
invoice numbers [cffcInvoiceNum]. I want the user to enter an invoice number
into a textbox, click the command button and have the main form switch to the
FranchiseID that matches the invoice number's FranchiseID. (I hope that's
clear...)
The Variant is capturing the correct FranchiseID, but the main form is not
moving to that record. I'm not using "Me" in this 'cause I figured with the
code being in a subform "Me" might mean the subform. Here's what I have so
far that's not working:
Dim rs As Object
Dim varFranID As Variant
If Me.txtFindInv <> Null Then
varFranID = DLookup("[FranchiseID]", "tblcffcMatSales",
"[cffcInvoiceNum] = " _
& Forms!frmFranchise!sfrmCffcMatSales.Form!txtFindInv)
Set rs = Forms!frmFranchise.RecordsetClone
rs.FindFirst "[FranchiseID] = " & Str(Nz(varFranID, 0))
If Not rs.EOF Then Forms!frmFranchise.Bookmark = rs.Bookmark
End If
Any help and guidance is appreciated.
tia!
