look up record on form using set criteria from another form

M

misha

try enclosing the Quote Number and the Quote Number Rev in
angle brackets since they contain spaces. also try to cast
the QuoteNumber and the QuoteRev values to the appropriate
numeric variable type using the CInt, CLng, CSng, or CDbl
function:

StandardQuoteJobNum.RecordsetClone.FindFirst "Forms!
[StandardQuoteJobNum].[Quote Number] = " & CLng
(QuoteNumber) & " AND Forms![StandardQuoteJobNum].[Quote
Number Rev]= " & CLng(QuoteRev) & ""
-----Original Message-----
it did not work here is the code i am using with the code
you sent
the command below operates off of a command button to find
the record i want i am searching using a Numeric value
beginning at 1000, currently i have 3 records in there as
this is a new database and i am running tests and
debugging before giving it out to the users.



Private Sub FindRecord_Click()
On Error GoTo Err_FindRecord_Click

StandardQuoteJobNum.RecordsetClone.FindFirst "Forms!
[StandardQuoteJobNum].Quote Number = " & QuoteNumber & "
AND Forms![StandardQuoteJobNum].Quote Number Rev= " &
QuoteRev & ""
StandardQuoteJobNum.Bookmark =
StandardQuoteJobNum.RecordsetClone.Bookmark
acMenuVer70

Exit_FindRecord_Click:
Exit Sub

Err_FindRecord_Click:
MsgBox Err.Description
Resume Exit_FindRecord_Click

End Sub
-----Original Message-----
the following code snippet finds a record on the
StandardQuoteJobNum based on your entries on the
QuoteInputBox form:

StandardQuoteJobNum.RecordsetClone.FindFirst "[SearchCrit
e
r
ia1]='" & txtTextBox1 & "' AND [SearchCriteria1]='" &
txtTextBox2 & "'"
StandardQuoteJobNum.Bookmark =
StandardQuoteJobNum.RecordsetClone.Bookmark

if you are searching based on numeric values, remove the
single quotes and cast the value of the two textboxes to
the appropriate type (e.g. CINT(txtTextBox1))

hope this helps
-----Original Message-----
Morning All,

Here's what i need to do. I have a Form
StandardQuoteJobNum based on the tbl Standard Quote Sheet,
it is opened by clicking a command Button on the Main
form. i have also created a QuoteInputBox form that has 2
unbound text boxes on it that opens when the
StandardQuoteJobNum form opens what i want the
QuoteInputBox form to do is when i put in a value in the
text controls to find the corresponding record on the
StandardQuoteJobNum Form and set the focus on that record
and then close the QuoteInputBox form when it is done, if
the record is not found or does not exist i have an error
msgbox that i have created to popup and let the user know
that there is no such record. i know how to use the find
record method but i am not sure how to make the data from
the text boxes look up the record on the
StandardQuoteJobNum Form.

any help would be great Have A Great 4th of July.

Greg



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top