A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Refering to a recordset



 
 
Thread Tools Display Modes
  #1  
Old August 4th, 2004, 06:23 AM
Richard
external usenet poster
 
Posts: n/a
Default Refering to a recordset

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


  #2  
Old August 4th, 2004, 07:19 AM
Albert D. Kallal
external usenet poster
 
Posts: n/a
Default Refering to a recordset

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
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada

http://www.attcanada.net/~kallal.msn


  #3  
Old August 5th, 2004, 01:48 AM
Richard
external usenet poster
 
Posts: n/a
Default Refering to a recordset

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




"Albert D. Kallal" wrote in message
...
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
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada

http://www.attcanada.net/~kallal.msn




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a recordset query stevens General Discussion 2 July 8th, 2004 01:08 AM
!Recordset from a parameterized query, as the form's recordset. Problem on sorting... Savvoulidis Iordanis Using Forms 2 June 24th, 2004 08:52 AM
Recordset Object Dominic New Users 4 May 21st, 2004 07:27 PM
Updating all records in a recordset BrianC New Users 4 May 12th, 2004 02:57 AM


All times are GMT +1. The time now is 08:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.