Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching recordsets of inactive forms

Status
Not open for further replies.

eussias

Programmer
Sep 25, 2001
97
AU
I currently have a text box and command button on each form for a project I'm working on. The user enters a number into the text box, presses the command button, and the relevant record is displayed. If there is no record, the user is informed. My question is, am I able to also scroll through the recordsets on the other inactive forms at the same time looking for the number, or do I just have to open each form at that specific record?
 
i think so: yes.
if the "Form1" object variable a pointer to your inactive form

myRecSet = Form1.recordsetclone

after the myRecSet searchable step by step the records or with the FindFirst, Findlast, FindNext methods

Syntax:
recordset.{FindFirst | FindLast | FindNext | FindPrevious} criteria
 
Not fully following what you're saying. I've set a pointer to the inactive form, but am now stumped
 
(DAO example)
...
dim MyForm, MyRecSet as object
Dim strCriter As String
set MyForm = Forms("...")
set MyRecSet = MyForm.RecordsetClone
MyRecSet.FindFirst
strCriter = "[ID] = " & myIDVariable & ""

With MyRecSet
' Populate recordset.
.MoveLast
' Find first record satisfying search string. Exit
' loop if no such record exists.
.FindFirst strCriter

If .NoMatch Then
MsgBox "No records found with " & _
End If
'.......
end with

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top