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

How To Set Focus to a Specific Record?

P: n/a
I have a button on "Form A" in the right margin of every record in my
recordset. When you click on a button, a dialog box ("Form B") pops
up that gives more details about that particular record.

The problem is that when I close the dialog, the cursor jumps to the
beginning of the recordset on "Form A". I want it to go back to the
record where I pressed the button.

What's the best way to set the focus to a particular record when
closing "Form B"?
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
The default behavior is that the current record will stay currrent.

The fact that it is jumping back to the first record suggests that you have
some code or macro that is causing the form to Requery. Remove that code.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"David Altemir" <al********@yahoo.com> wrote in message
news:77**************************@posting.google.c om...
I have a button on "Form A" in the right margin of every record in my
recordset. When you click on a button, a dialog box ("Form B") pops
up that gives more details about that particular record.

The problem is that when I close the dialog, the cursor jumps to the
beginning of the recordset on "Form A". I want it to go back to the
record where I pressed the button.

What's the best way to set the focus to a particular record when
closing "Form B"?

Nov 13 '05 #2

P: n/a
I did have a DoCmd.Requery statement in the OnClose event of Form B
and so I took it out as you suggested. Still jumps to the start of
the recordset though and I can find any other places where a requery
is being issued after the transition to Form A.

Is there a way to force the focus back to the orignal record?

The default behavior is that the current record will stay currrent.

The fact that it is jumping back to the first record suggests that you have
some code or macro that is causing the form to Requery. Remove that code.
"David Altemir" <al********@yahoo.com> wrote in message
news:77**************************@posting.google.c om...
I have a button on "Form A" in the right margin of every record in my
recordset. When you click on a button, a dialog box ("Form B") pops
up that gives more details about that particular record.

The problem is that when I close the dialog, the cursor jumps to the
beginning of the recordset on "Form A". I want it to go back to the
record where I pressed the button.

What's the best way to set the focus to a particular record when
closing "Form B"?

Nov 13 '05 #3

P: n/a
If you know the primary key value of the record you are looking for, you can
FindFirst on the form's RecordsetClone, but it would be better to track down
why the problem occurred if possible.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"David Altemir" <al********@yahoo.com> wrote in message
news:77**************************@posting.google.c om...
I did have a DoCmd.Requery statement in the OnClose event of Form B
and so I took it out as you suggested. Still jumps to the start of
the recordset though and I can find any other places where a requery
is being issued after the transition to Form A.

Is there a way to force the focus back to the orignal record?

The default behavior is that the current record will stay currrent.

The fact that it is jumping back to the first record suggests that you
have
some code or macro that is causing the form to Requery. Remove that code.
"David Altemir" <al********@yahoo.com> wrote in message
news:77**************************@posting.google.c om...
>I have a button on "Form A" in the right margin of every record in my
> recordset. When you click on a button, a dialog box ("Form B") pops
> up that gives more details about that particular record.
>
> The problem is that when I close the dialog, the cursor jumps to the
> beginning of the recordset on "Form A". I want it to go back to the
> record where I pressed the button.
>
> What's the best way to set the focus to a particular record when
> closing "Form B"?

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.