Hi All,
I have a mainform that hold a template for house remodeling. Then I have a subform that holds the tasks needed to accomplish the house remodel. The subfrom is a list of continuous records. On particular fields in the subform, I use an append query to add records as needed. The problem is that once the append takes place the cursor goes back to the first record. How do I get the cursor to stay on the new appended record.
Similar to the above problem, there are certain fields in the subform that are updated. When a value is changed, a macro runs that includes an update query to update the cost totals on the subform and on the mainform. When finished, the cursor jumps to the mainform and has the first record selected in the subform. I just want it to go to the next field in the subform as if I had no macro at all.
The macro looks like this:
Save Record
Open Query (update query)
refresh
removefiltersor t
Any ideas on how I can tame the wild cursor?
Thanks!
7 2304 ADezii 8,834
Recognized Expert Expert
Hi All,
I have a mainform that hold a template for house remodeling. Then I have a subform that holds the tasks needed to accomplish the house remodel. The subfrom is a list of continuous records. On particular fields in the subform, I use an append query to add records as needed. The problem is that once the append takes place the cursor goes back to the first record. How do I get the cursor to stay on the new appended record.
Similar to the above problem, there are certain fields in the subform that are updated. When a value is changed, a macro runs that includes an update query to update the cost totals on the subform and on the mainform. When finished, the cursor jumps to the mainform and has the first record selected in the subform. I just want it to go to the next field in the subform as if I had no macro at all.
The macro looks like this:
Save Record
Open Query (update query)
refresh
removefiltersor t
Any ideas on how I can tame the wild cursor?
Thanks!
Try this Link first, if it doesn't help then respond to the question. http://www.thescripts.com/forum/thre...-bookmark.html
Where is the Update Query being run from?
Thanks much for the answer. I will try it out now. The query is being run from a macro, After reading some of the the posting here I'm beginning to realize that running anything from a macro may not be the best idea. Thanks and I will let you know if this works.
That's right! Macros are rigid and very limited in the abilities, and more importantly, have no provision for error handling!
Welcome to TheScripts!
Linq ;0)>
Thanks. The code works and brings me back to the record which is great(!) but it doesn't bring me back to the correct fieild--so I'm almost there. Is there a way to bookmark the exact field?
ADezii 8,834
Recognized Expert Expert
Thanks. The code works and brings me back to the record which is great(!) but it doesn't bring me back to the correct fieild--so I'm almost there. Is there a way to bookmark the exact field?
You can experiment with code similar to that which is listed below: - Static ctl As Control
-
-
'Set the Absolute Path to your Control
-
Set ctl = Forms!frmEmployees!subfChild.Form![FirstName]
-
-
DoCmd.OpenQuery "<Action Query here>"
-
-
'Return Focus to the Original Control
-
ctl.SetFocus
Works Perfect. Thanks for all of your help!
ADezii 8,834
Recognized Expert Expert
Works Perfect. Thanks for all of your help!
Glad it worked out for you.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Rey |
last post by:
Howdy all.
Appreciate your help with several problems I'm having:
I'm trying to determine if the Visit subform (subformVisits) has a new
record or been changed, i.e. dirty. The form that contains the subform is
named Clients.
I have this code in the Add Client btn:
If Forms!Clients.subformVisits!VisitDirty = True Then
MsgBox "Visit subform is dirty!"
|
by: Max Harvey |
last post by:
Hi,
I made up a nice little form which had its own sub form in it.
I made a litle VB code so that when I pressed a button it would move
form the form (frmConference) to the subform
(frmBookingBookingBased), start a new record, and copy some values
form the form into some fields in the subform, and then leave the
cursor sitting (in focus) at the begining of the subform.
|
by: Scott |
last post by:
In my database, I have a form with a subform. I had everything working
correctly - the correct records would display on the subform for each
record on the form. I could edit, add, and delete on the subform.
I added a field to my table, and modified the design of my subform. Now,
data is not getting displayed on the subform for any form records. I did
not change any properties.
I'm on XP Pro and using MS Office 2000 Pro.
|
by: jdph40 |
last post by:
On a form, I have a list box and a subform. After a name is selected
in the list box, I would like for the cursor to automatically tab to
the first field in the subform. Can someone give me a tip on this?
TIA,
JD
|
by: Sally |
last post by:
When I click on a control in a subform, what is the syntax to return the
name of the subform control on the main form that contains the subform?
MsgBox "MySubform is in " & < ???? >
Thanks,
Sally
| |
by: Simone |
last post by:
Hi All,
I have a Find Record button setup in most of my forms in order to find
a specific customer's details. I have just noticed today though that
this search will only find the customer if it already has linked data
in the subform. This totally defeats the purpose of my search, which
is to find an existing customer's details in order to enter new data
in the subform.
I was wondering if there is a way, in the form/subform situation,...
|
by: google |
last post by:
I have a form with several subforms. Users enter the data, then on the
parent there is a command button that runs code to generate a .pdf
document from a report based on the data they are working with. If a
user enters data in a subform, then directly clicks the command button
on the parent form, the data in the subform is not included in their
document. I THOUGHT that as soon as focus left the subform, any
pending changes to the data...
|
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 next
record on that subform. This seems like that this should be a fairly
easy thing to accomplish, but I cannot get it to reposition the cursor
on the next record. The following is my code segment:
Any help would be greatly appreciated!!!
...
|
by: jac43 |
last post by:
Hi all just recently a large postgres database that has been happily chugging away with no problems has gone a bit wild. It is in the ~/data/base/16450 directory were there are suddenly since Oct 10th lots of 1GB files being created and not going away (see output from ls below). This is chewing up the disk space at a phenomenal rate, does anyone have any clues as to what would cause this to start happening and how to fix it?
Thanks in advance...
|
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,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
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...
| |