L
Lee
Hello everyone,
I'm trying to create a 'Find' type of form to locate
particular people in a subform.
The main form holds the details of an Order, and the
subform lists the products that comprise that order.
I've got a form (called frmGoTo) where I would like the
users to put in a particular product name and the main
form/subform will 'jump' to the first applicable order
for that product. Here's the code on this 'Find' form:
Dim frm As Form
Dim rec As Recordset
Set frm = Forms![Orders]![Products]
Set rec = frm.RecordsetClone
If IsNull(Me!GoTo) Then
MsgBox "First enter a Product to look up!",
vbExclamation, "Oops!"
Me!GoTo.SetFocus
Else
rec.FindFirst "Forms![Orders]![Products]![ProdName]="
Like "*" & "'" & Me!GoTo & "'" & "*"
End If
If rec.NoMatch Then
MsgBox "Unable to locate the Product. Try again.",
vbExclamation, "Product not found..."
Else
frm.Bookmark = rec.Bookmark
End If
rec.Close
I'm get 'type mismatch' errors and other things I've
tried just make it worse! Can you help??
TIA
Regards,
Lee
I'm trying to create a 'Find' type of form to locate
particular people in a subform.
The main form holds the details of an Order, and the
subform lists the products that comprise that order.
I've got a form (called frmGoTo) where I would like the
users to put in a particular product name and the main
form/subform will 'jump' to the first applicable order
for that product. Here's the code on this 'Find' form:
Dim frm As Form
Dim rec As Recordset
Set frm = Forms![Orders]![Products]
Set rec = frm.RecordsetClone
If IsNull(Me!GoTo) Then
MsgBox "First enter a Product to look up!",
vbExclamation, "Oops!"
Me!GoTo.SetFocus
Else
rec.FindFirst "Forms![Orders]![Products]![ProdName]="
Like "*" & "'" & Me!GoTo & "'" & "*"
End If
If rec.NoMatch Then
MsgBox "Unable to locate the Product. Try again.",
vbExclamation, "Product not found..."
Else
frm.Bookmark = rec.Bookmark
End If
rec.Close
I'm get 'type mismatch' errors and other things I've
tried just make it worse! Can you help??
TIA
Regards,
Lee