By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,045 Members | 1,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,045 IT Pros & Developers. It's quick & easy.

Remembering what record and field and returning after running someVB

P: n/a
Ben
I have a Tabular form bound to a table. The purpose of this form is to
get times from a timer and record them in a field. The timer dumps the
time automatically through a serial port. When the time is recorded it
goes to the next record. Sometimes a user may have to skip a record and
come back. All of this is no problem and works great.

I have 3 buttons that will set any penalties in a record. The person
just needs to hit a button to modify the penalty field. The problem is
when the person hits the button the cursor is no longer in the record
field. As part of the VB for the button I need to know where what record
and field the cursor was at and after making the adjustment to the
penalty to return there.

Its not enough to return to the next available record since it maybe
skipped. Relying on the user to manually do it is not a good idea. The
person running it maybe doing a dozen different things at the same time
and limiting errors is of course important. Also the time frames will be
short. Anywhere between 30-60 seconds between runs.

I know how to set the focus to whatever control I want but figuring what
record I am in then returning has me stumped.

Thanks
Ben

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I think you want to set some Form level variables.

On "Got Focus" or "On Enter" on each of the fields you want to track, set
the values of the form variables. That way when the cursor leaves the
record/field you know the last place the cursor was.

You should be able to locate a record if you have saved the PrimaryKey value
to a variable and the field by saving the name of the control.

"Ben" <be****@hotmail.com> wrote in message
news:3F**************@hotmail.com...
I have a Tabular form bound to a table. The purpose of this form is to
get times from a timer and record them in a field. The timer dumps the
time automatically through a serial port. When the time is recorded it
goes to the next record. Sometimes a user may have to skip a record and
come back. All of this is no problem and works great.

I have 3 buttons that will set any penalties in a record. The person
just needs to hit a button to modify the penalty field. The problem is
when the person hits the button the cursor is no longer in the record
field. As part of the VB for the button I need to know where what record
and field the cursor was at and after making the adjustment to the
penalty to return there.

Its not enough to return to the next available record since it maybe
skipped. Relying on the user to manually do it is not a good idea. The
person running it maybe doing a dozen different things at the same time
and limiting errors is of course important. Also the time frames will be
short. Anywhere between 30-60 seconds between runs.

I know how to set the focus to whatever control I want but figuring what
record I am in then returning has me stumped.

Thanks
Ben

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.