473,401 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

How To Set Focus to a Specific Record?

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
3 5191
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Randell D. | last post by:
Folks, I'm working on a contact name/address database whereby a slimed down list is shown in the main window. When a record is selected, the complete record is displayed in a new window via a...
17
by: Neil Ginsberg | last post by:
OK, this is a stupid thing, but I can't seem to get this to work. I have a form with a subform (in continuous form view). A combo box on the main form has code in the AfterUpdate event which adds a...
1
by: cider123 | last post by:
I've tried working with the SelectedIndices and Items.Selected attributes to get the problem to go away, but not having any luck. Questions I have are: 1) How do you move (using code) the...
1
by: kaeldowdy | last post by:
This one is stumping me! I have a Form/Subform arrangement. The main form is set as a Single Form and the sub form is set as Continuous Forms. On the Form_AfterUpdate event of the subform, I...
5
by: LabGeek | last post by:
I have an Access application that I have created that collects data from a scanner and from a weighting scale. The data from the scanner are unique identifiers (barcodes) and the scanner is...
16
by: google | last post by:
In a continuous form the following code is under a button in the form header. In Access 2003 and earlier, this goes to a new record, then adds relevant data to that new record. DoCmd.GoToRecord...
7
by: =?Utf-8?B?dmJ0cnlpbmc=?= | last post by:
I am using a switch statement, to check for valid user hours. If the hours control is blank, I want to place the cursor back to the hours control for the user. The following code does NOT work:...
1
by: stuart | last post by:
I have a list of records in a subform that a user can either edit or delete. This is an unbound form. If the user deletes a record, I want to refresh the form, and then position the cursor on the...
2
by: angi35 | last post by:
I hope this is an easy question for someone out there. In Access 2000…I have a MainForm with a tab control (MAIN TABS) with 7 tabs. Within each tab is a SubForm. Within each SubForm is a tab...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.