473,799 Members | 3,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make cmd buttons (undo & clear) work on subforms

imrosie
222 New Member
Hello anyone,

Is there someone that has a routine to do this? On the Main form I have cmd buttons that clear and undo..

Specifically the Undo doesn't undo the subforms, just the Main form. I also am not sure how to make my clear button, clear out all controls on all 3 forms.

thanks
Sep 14 '07 #1
3 2716
MikeTheBike
639 Recognized Expert Contributor
Hello anyone,

Is there someone that has a routine to do this? On the Main form I have cmd buttons that clear and undo..

Specifically the Undo doesn't undo the subforms, just the Main form. I also am not sure how to make my clear button, clear out all controls on all 3 forms.

thanks
Hi imrose

Haven't you posted version of this question on another forum?

However, I don't think you can do what you want because after you change the focus from the subform to the main form (ie. when you click the undo button on the main form) then the subform automatically saves any changes, and is then no longer dirty ??
Any undo on the subform will then cause an error !

FYI
To refer to the subform and its control the syntax is

Me.SubformContr olName.Form.Req uery (to requery the sub form the main form)

Me.SubformContr olName.Form.txt ControlName="So me Value" (to set a txtbox value).

HTH


MTB
Sep 14 '07 #2
imrosie
222 New Member
Hi imrose

Haven't you posted version of this question on another forum?

However, I don't think you can do what you want because after you change the focus from the subform to the main form (ie. when you click the undo button on the main form) then the subform automatically saves any changes, and is then no longer dirty ??
Any undo on the subform will then cause an error !

FYI
To refer to the subform and its control the syntax is

Me.SubformContr olName.Form.Req uery (to requery the sub form the main form)

Me.SubformContr olName.Form.txt ControlName="So me Value" (to set a txtbox value).

HTH


MTB
HIi MikeTHeBike,

Yes this forum, but I phrased the title different. Got no response so I thought my title was confusing. I rephrased. thanks
Rosie
Sep 14 '07 #3
hema1985
1 New Member
ok i know this is an old post but i didnt see proper solution for this issue. i just came across the same problem and looked it up this forum popped up. anyways it took 5 minutes for me to come up with a solution. what i did is in the subform itself i put
Expand|Select|Wrap|Line Numbers
  1. If Me.Dirty = True Then
  2.         If MsgBox("Do you want to Save the record", vbYesNo, "Save") = vbNo Then Me.Undo
  3. End If
in the beforeUpdate event. that works but it would prompt. offcourse you can customize the message instead of do you want to save the record.

let me know if you did find any other way.
May 30 '12 #4

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

Similar topics

1
3734
by: xmp333 | last post by:
Hi, I have a form that is designed as a data sheet view. Attached to this is a subform with some VB code. When the user clicks on a row, the subform should pop up and run the VB code which accesses the record corresponding to the row clicked. To get this row, I tried using Me.Parent.Bookmark. Unfortunately, this gets the "Current Record" which is set via the navigation
18
13630
by: Darryl Kerkeslager | last post by:
I don't do much with subforms - in fact I've deliberately avoided them - but .... I have a tab control that will contain several subforms, each bound to a separate table, and each table/subform will relate to the same person - but the subform data will not be 'linked' to the main form. I want to have one Cancel button for all the undo operations on all the subforms, so the individul subform's Public Sub, Form_Cancel will be called...
0
1280
by: Wiktor Zychla | last post by:
I am still trying to get the Undo function work on Internet Explorer editor hosted as activex in my c# application. Some time ago I've found a note at msdn that says "undo is not supported". I gave up. But lately I've downloaded LutzRoeder Writer that makes use of undo function. I've looked at the code and it turns out that it uses IOleCommandTarget interface to invoke this command.
3
7832
by: Teis Draiby | last post by:
I'm looking for some information (books, articles, tutorials) on how to implement a multiple undo/redo framework. I'm a beginner in this so I prefer information specifically targeting C# with code samples. Is seems that the 'Command Pattern' is the way to achieve it (?). If you know any good resources I would be very happy to know! Thank you very much!, Teis
6
5944
by: Ian Boyd | last post by:
Every time during development we had to make table changes, we use Control Center. Most of the time, Control Center fails. If you try to "undo all", it doesn't, and you end up losing your identity seed, or your constraints, or your triggers, or your table. Talking to developers at other companies who have had the misfortune of using DB2, they are adamant that you cannot use the tools; they are buggy and you just have to resign yourself to...
7
5313
by: Richard Sherratt | last post by:
I'm trying to stop users deleting an existing value in a field. If they go to an existing record and hit delete, I want to give an error message and reverse the change. The BeforeUpdate event is firing and they get the error message. But when they click "OK", the change is not undone. They can hit enter and go on to the next field with the null not being undone. However, if they change to an illegal (not null) value, the change is undone....
1
1789
by: tarabztk | last post by:
MSACCESS 2003 : How to use command buttons to display different subforms I have an application that display information about Pipelines and these pipelines have many other equipments attached to them like ‘Valves’, ‘Tanks’, ‘Pumps’, etc. In this application I display using Access form, all details about a selected Pipeline. And I included in this form, a sub-form which display valves information by default. What I would like to do is...
1
1798
imrosie
by: imrosie | last post by:
Hello experts, I have 3 cmd buttons (undo changes, clear order and save order). I added a second subform and moved some controls around...Now I'm having difficulty getting them to work again on either of the subforms, only works ont the main form. The two subforms are bridged together to the Main form through a text control.. Has any experienced this and can direct me how to get them working again? thanks. Better yet,does anyone have a...
2
2090
by: Hulm1 | last post by:
I have made amazing progress using google and pinching code!. This one has me stuck though. I have a main form "Enquiry_Edit". In the main form are several subforms which become visible based on a TRUE click on a checkbox "VapourExtraction" with the following On Click code. The following is an example of one subform Me!.Form.Visible = Me.VapourExtraction This all works fine. BUT! When I uncheck the "vapourextraction" check box,...
0
9541
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
10485
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, 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...
0
10252
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...
0
10027
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 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...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
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
5463
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...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
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 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.