Refering to a recordset

R

Richard

Hi

I have an unbound form and I link it with the data using the recordset
query.

I would like to open a recordset in a form with the Onopen event.

How do I refer back to the recordset with a different event?

I don't want to open and close the recordset every time I click on tbe
button. I believe that leaving the recordset open and looking up the data
with Rs.look function when I need the record will quicken the search. Am I
right or is there a simpler way?

Thanks in advance
Richard
 
A

Albert D. Kallal

I generally don't find any advantage or performance gain by using a un-bound
form.

if you open the form with the "where" clause to restrict the number of
records that the form loads, and the "where" clause is on a index field,
then only the ONE record gets loaded.

I doubt that using rs.look will be any faster then the above.

As a rule, it is better to just load the one record then trying to "scan" a
reocrdset. You don't mention how large, or what size of files you are
working with.

With small files of only 50,000 records, and say 10 users on a typical
network, form loads will be instant, and no perceptible delay should be
visible when using bound forms with a where clause.

The are also much less work:

dim strWhere as string
dim strInvoice as string


strInvoice = InputBox("What invoice number to view?")

strWhere = "InvoiceNumber = '" & strInvoice & "'"

docmd.OpenForm "frmCustomerInvoices",,,strWhere


The above is air code...but gives the general idea of how the "where" clause
can be used. Here is some more ideas, and screen shots on high speed
searching:

http://www.attcanada.net/~kallal.msn/Search/index.html
 
R

Richard

Hi Albert

Thanks for taking time to reply. I use the unbound forms only for data
entry, and use bound forms for data reference.

I am working on a form where I thought the users might want to move back to
a provious record. So what I did was, open a recordset, find the existing
Id, move previous and link the record to the form where the users may edit
it. It is a bit slow to load and was thinking for a faster method.

The amount of records is not many, around 20,000 plus. That means I should
take a look at the design again.

Thanks again for your insight

Richard
 
Top