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!

Using 'Sendkeys' Function to cycle through records

Status
Not open for further replies.

bsagal

Technical User
Jul 17, 2003
35
CA
Hello,

I am using the Sendkeys function to cycle through a bunch of records.

Using code, as the sendkeys function goes through the list of records, a subform is being updated.

The problem is that sendkeys appears to lag, what i mean is that even after it goes to the next record, the subform doesn't immediately update to indicate the changes.

This causes a lag, and as a result information is entered in the wrong records.

Anybody know why?

Thanks
 
yeah, because SENDKEYS SUCKS. Don't use it. There are plenty of other ways to navigate.

word to the wise, use GoToRecord, or MoveNext, or Move.



Randall Vollen
National City Bank Corp.
 
SendKeys does have its place, and sometimes can be used to get you out of a jam, but when moving through recordsets it's not the best solution.

Try a looping method like Randall suggested.

If you need help with this let us know.
 
Thanks for your reply.

I am now using GoToRecord, it is a lot faster, however the same problem exists.

For some reason it continues to update the previous record, its always lagging by 1 i.e even after it goes to the next record, the subform continues to show the information that corresponds to the record above it.

Any ideas why?

Thanks
 
Hi bsagal,

Try using requery on your subform every time you use GoToRecord.

natatbh
 
Thanks for your reply.

I thought about that, but since the subform is linked to the main form, anytime a record is selected it should automatically update to show the results of the selected record.

So just to give you guys an idea what i'm doing, here's an example that illustrates it:

On the main form:

CANADA
AMERICA
MEXICO

On the sub form:

Population
Visible Minorities

Now, when someone clicks the "Update" Button, the program starts first on canada, does some calculations and enters the results into population, and visible minorities which reside on the subform.

Then using GoTorecord, it goes to America, does the same thing, and then mexico.

The problem i'm having is that American's results are placed in canada's, and mexico's in america's i.E there is a lag.

Any ideas?
 
Hi,

It seems that the data in your form is actually updated from canda to america and thats why you see the american results
in the subform. For some reason your main form doesn't get updated to reflect the change from canada to america. Therefor it gives the effect of showing America's results for canada.
Try to requery your "main" form after GoToRecord, this should set the data in your main form to match the actual data you are viewing in the subform

natatbh
 
Thanks Very much folks!

I got it work!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top