473,473 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need cursor to go to next field after requery

17 New Member
I have a form with several subforms. In the main form I need to run a requery for several subforms to update info. But when I requery the cursor goes back to the top of the form. I need the cursor to end up in the next field after the field that contained the requery command. I have done this before but I can't remember the code. Can anyone refresh my memory? Thanks

Assitional Info:
Main Form = Billing Work Form
Field that has requery command= Payroll end
Want cursor to go to new record in: Units Worked Query subform
Thanks
Nov 30 '08 #1
8 10166
nico5038
3,080 Recognized Expert Specialist
Did you try:
Expand|Select|Wrap|Line Numbers
  1. Me.[Units Worked Query subform].setfocus
  2. 'or for a specific field:
  3. Me.[Units Worked Query subform].form!Fieldname.setfocus
  4.  
Nic;o)
Nov 30 '08 #2
Dbar10
17 New Member
Thank you! Except the cursor lands in the first record of the subform. Can I get it to land on a new record? Thanks
Nov 30 '08 #3
nico5038
3,080 Recognized Expert Specialist
For that you'll need to use a bookmark.
You could check out:
Microsoft Access tips: Duplicate the record in form and subform

Nic;o)
Nov 30 '08 #4
Dbar10
17 New Member
Nico, I think you missunderstood me? I don't want to duplicate a record. When the cursor lands in the subform, it lands on the first existing record in my datasheet view. I don't want the user to have to hit the new record command to get to a new record. I want the cursor to land on a new record after it rusn the requery. Can you help me? Thanks
Nov 30 '08 #5
nico5038
3,080 Recognized Expert Specialist
I was pointing to the way the "Bookmark" is used, not the duplication of the record.
With a bookmark you can position in a subform on a particular record.

For the new record a shortcut might be to use the GoToRecord command like:
Expand|Select|Wrap|Line Numbers
  1. Me.[Units Worked Query subform].SetFocus
  2. DoCmd.GoToRecord acActiveDataObject, , acNewRec
  3.  
Nic;o)
Dec 1 '08 #6
Dbar10
17 New Member
Nico, Thank you very much. It looks like I misunderstood. Your solution worked great, I really appreciate it.

Dbar10
Dec 1 '08 #7
Dbar10
17 New Member
Nico, I am still having trouble. I applied your solution last night but I had it operating on the LostFocus command. I found that the cursor stuck in the new record of subform. I moved the code to the AfterUpdate action and the cursor does not go to the new record in the subform. It goes to the first record in the datasheet instead. I don't understand why it worked on lostfocus and not afterupdate. Can you help me?
Dec 2 '08 #8
nico5038
3,080 Recognized Expert Specialist
Why don't you use a Requery/Refresh button ?

Nic;o)
Dec 3 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: William Wisnieski | last post by:
Hello Everyone, Access 2000, I have a main unbound form with a bound datasheet subform . The subform is bound to a query that returns records based on criteria in the main form. The user...
5
by: ChadDiesel | last post by:
My basic question is why does my print report button on my subform print a blank report when my cursor is on a blank entry line? Here is a more detailed explanation of my problem. I have a...
4
by: SQLNewbie | last post by:
I have the following cursor that I am comparing 2 tables, the production table and a copy of the production table, I want results of all address's that are like the address1 field...the problem...
13
by: James | last post by:
Is this possible? I want to pass an array into a function that contains txtBox.Text properties... I was thinking something like this, but I know it won't work Dim vendorFields(9) As String ...
1
by: ebernedo | last post by:
Hey guys, I have two main questions First off (pictures are kind of blurry) I have this table http://i197.photobucket.com/albums/aa109/ebernedo/DiscTable.jpg And thats my database I use my...
2
by: Arnold | last post by:
Hi Gurus, I am getting the error 3420 "object invalid or no longer set" at in the line -- rst.FindFirst "=" & NextPK --in the code below. I simply have a continuous main form that is, by...
26
kcdoell
by: kcdoell | last post by:
Hello: I have a continuous form that displays records. In the AfterUpdate event of one of the fields, Binding_Percentage, I have the following code: Private Sub...
3
by: Klaus Brune | last post by:
Hello all, When one tabs through a form (specifically, in Firefox), all the text in a field is automatically selected. What I'm looking for is a way to put a function (in onFocus perhaps)...
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
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.