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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clicking the next record button twice to move to next record

Status
Not open for further replies.

dabowles

MIS
Jun 26, 2001
64
US
Hi,
I am not sure what I have done to cause this or if it is not fixable. I have a form that whenever I try to use the standard record navigation buttons at the bottom of the form I have to click twice the forward and reverse record buttons twice in order to get it to move to the next record. The first time in the status bar at the bottom of the screen when I click it, it displays "Calculating..." and the second time I press it, it will move to the next or previous record. Is this something that is always going to happen, because I do have 3 DLookup fields in the record and one field that is calculated based on the entries of two other fields. I also have a couple of macros attached to the events of two fields and one macro attached to the OnCurrent event of the form object. Is there anyway I can change it so that it only takes one click instead of two?

Thanks,
David
 
yes that alway going to happen
I would see if you could move the Dlookup's some where else

Now you can spped it up dramtically if you replace those dlookups with SQL.
Also you can return a bunch of values with on SQL rather than only one value with Dlookup.

here are the basics

Dim db As database
Dim rst As Recordset
Dim SQL As String
Set db = CurrentDb
' Open table and find value(s)
SQL = "Select * From yourTable Where Yourfield = " & Me!SomeTextbox_on_your_form
Set rst = db.openrecordset(SQL)

x = rst!Somefield
y = rst!SomeOtherfield
z = rst!moreStill
' etc

rst.Close
db.Close



DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top