473,687 Members | 3,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set focus to particular record using Continuous Forms

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_AfterUpdat e event of the subform, I run some code that
affects the main form which forces focus *away* from the subform and
puts it to the main form.

I need to keep focus on the subform when the code in the
Form_AfterUpdat e event finishes. Sounds simple enough, right!? I
tried a Me.CtrlName.Set Focus in the subform after I'm done running my
code. However, in continuous forms, it defaults back to the *first*
row. I'm wanting to set focus back to a specific row/instance in the
subform.

I tried DoCmd.RunComman d acCmdRecordsGoT oLast and the like, but I want
to get focus to where I last left off, not the first, last, new, etc.
record.

I do have a hidden unique identifier if that would be used as part of
the solution.

Any thoughts? If you need more info, let me know!

Thanks,
Kael

Mar 30 '06 #1
1 30473
Well, I think I got it figured out. It was easier than I thought...

Form_AfterUpdat e()
Dim lngPosition as Long

lngPosition = Me.CurrentRecor d ' capture index position of record
currently selected

' *** do my code where my subform loses focus to parent form ***

Me.ControlName. SetFocus ' go back to sub form

Me.Form.Records et.Move lngPosition ' navigate back to original
record position
End Sub

I still have some debugging to be sure its fine tuned correctly to
account for all possible situations, but this got me 90% of the way
there. I guess it was easier than I thought (Me.CurrentReco rd and
Me.SelTop didn't jump out at me at first!)

Thanks!

Mar 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4755
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record onto the bottom of the list (even though it keeps its record number). Also, There are certin names that i click on the list, and it will not bring it up, rather it brings to the first record (no matter how many times i try going to that...
2
12546
by: aaj | last post by:
Hi all I have a small but rather annoying problem with continuos forms, and am wondering if anyone can suggest a method of getting over it. The front end is Access 2002 with the BE being SQL Server 2000. I have a continuous bound form that is populated from a small recordset when the form opens. The form has lots of other bits, but my problem is with a single text box and an on-click event.
3
7913
by: Mark | last post by:
Hi there, I have a subform, set as a continuous form. When a user selects a particular record in that subform, how can I make that particular record stand out (color or font change, size, etc) from the other records in the list? Thank you in advance, Mark
2
4012
by: Cro | last post by:
Dear Access Developers, I am developing a form with 'default view' set to "continuous forms". I am suffering with a problem I can't yet see a solution too. Each record has many fields. Two fields I would like to add a little extra functionality to are a check box and a combo box. More explicitly, I would like the 'enabled' property of a combo box control to be dependent on the value of a check box (a 'yes/no' field) in the same...
19
4097
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
5
2200
by: Armando | last post by:
I recently saw the tail end of a "Continuous forms" discussion, but not enough was available to see if this will be a PITA repeat question. Sorry if it is. On a form with its Default View set to Continuous Forms, I need to catch the event when the repeating section iterates for each record in the underlying table. I have buttons on the repeating section which will get their captions from the current line in the table, or which will...
0
1331
by: Steve Jorgensen | last post by:
One thing that makes Access so useful rapid development tool is the seemless way it links user interfaces to data storage. That is also one of its most maddening weaknesses, since Access doesn't offer much help when you need the UI metaphor to differ from the data storage schema in any significant way. Here's one trick, though, that you can use to do some simple forms of uncoupling UI behavior from the back-end structure, and still take...
4
9162
by: neoman007 | last post by:
I have a form (frm_approval) which is based on a query (qry_unapproved). The query queries a table (tbl_total) for records that are unapproved and shows these records in (frm_approval) so the approver can use the form to approve them via checking a check box. The form is set to Continuous View and I get many rows of textboxes (RecordName & RecordQty), each row for 1 record to be approved. For every record, I have a checkbox field (chkbox) which...
2
2161
by: rajvbprogramer | last post by:
here is my problem. i have two records. one containing 20 records and second containing 30 records. now i want the recordcount property to use and go to the 21 record. i m calculating the recordcount of both the record. now i m doing this a = rs.recordcount b = rs1.recordcount for x = b+1 to a
0
8590
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8527
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8947
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8781
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6453
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5806
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2964
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 we have to send another system
2
2214
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1948
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.