473,421 Members | 1,507 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,421 software developers and data experts.

Which event(s) can I use to catch a change of a field on subform?

Hello
I have an application in MS Access 2000. I have a form, which includes
a subform. The subform is based on a table, but locked for any
editing. There is Edit button. When clicked, it starts a separate
unbound form with all the fields, which are on the subform. The fields
are filled in with data programmatically. User edits. Edited fields
are copied into fields on the subform programmatically as well.
I need to catch change in one of the fields either at the moment, when
the change gets into the field on subform, or when user clicks a
navigation button on the parent form to navigate to another record.
I cannot use OnChange event of this field, because OnChange event
doesn't work, if field is changed from code.
I tried If Dirty and AfterUpdate events of the subform and AfterUpdate
event of the control, but despite the fact that the change is saved in
the table, the form doesn't become dirty and doesn't even start
AfterUpdate event, to my greatest surprise. I thought that if a value
is changed in the form based on a table, AfterUpdate event happens
always...
Which event(s) can I use to catch a change of a field on subform? Any
advice will be greatly appreciated.
Thank you.
Galina
Nov 12 '05 #1
2 4362
On 26 Jan 2004 07:23:07 -0800, Galina wrote:
Hello
I have an application in MS Access 2000. I have a form, which includes
a subform. The subform is based on a table, but locked for any
editing. There is Edit button. When clicked, it starts a separate
unbound form with all the fields, which are on the subform. The fields
are filled in with data programmatically. User edits. Edited fields
are copied into fields on the subform programmatically as well.
I need to catch change in one of the fields either at the moment, when
the change gets into the field on subform, or when user clicks a
navigation button on the parent form to navigate to another record.
I cannot use OnChange event of this field, because OnChange event
doesn't work, if field is changed from code.
I tried If Dirty and AfterUpdate events of the subform and AfterUpdate
event of the control, but despite the fact that the change is saved in
the table, the form doesn't become dirty and doesn't even start
AfterUpdate event, to my greatest surprise. I thought that if a value
is changed in the form based on a table, AfterUpdate event happens
always...
Which event(s) can I use to catch a change of a field on subform? Any
advice will be greatly appreciated.
Thank you.
Galina


If your changes are being made in a form other than the one you want to
update, then the Update/Change/Dirty events on the first form are not
firing as nothing has occured on that one. You'll need to have the form
used for editing tell the first form to refresh itself -
Forms!FirstForm.Refresh

If you want the first form to retain it's record posistion after the
refresh, it may be necessary to determine what record is active first, then
either filter the form after refresh, set it's bookmark to the desired
record or using one of the Find methods of it's recordsetclone.
--
Mike Storr
veraccess.com
Nov 12 '05 #2
Mike
Thank you. I should have known it myself.
Galina
Mike Storr <st******@sympatico.ca> wrote in message news:<1k*******************************@40tude.net >...
On 26 Jan 2004 07:23:07 -0800, Galina wrote:
Hello
I have an application in MS Access 2000. I have a form, which includes
a subform. The subform is based on a table, but locked for any
editing. There is Edit button. When clicked, it starts a separate
unbound form with all the fields, which are on the subform. The fields
are filled in with data programmatically. User edits. Edited fields
are copied into fields on the subform programmatically as well.
I need to catch change in one of the fields either at the moment, when
the change gets into the field on subform, or when user clicks a
navigation button on the parent form to navigate to another record.
I cannot use OnChange event of this field, because OnChange event
doesn't work, if field is changed from code.
I tried If Dirty and AfterUpdate events of the subform and AfterUpdate
event of the control, but despite the fact that the change is saved in
the table, the form doesn't become dirty and doesn't even start
AfterUpdate event, to my greatest surprise. I thought that if a value
is changed in the form based on a table, AfterUpdate event happens
always...
Which event(s) can I use to catch a change of a field on subform? Any
advice will be greatly appreciated.
Thank you.
Galina


If your changes are being made in a form other than the one you want to
update, then the Update/Change/Dirty events on the first form are not
firing as nothing has occured on that one. You'll need to have the form
used for editing tell the first form to refresh itself -
Forms!FirstForm.Refresh

If you want the first form to retain it's record posistion after the
refresh, it may be necessary to determine what record is active first, then
either filter the form after refresh, set it's bookmark to the desired
record or using one of the Find methods of it's recordsetclone.

Nov 12 '05 #3

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

Similar topics

1
by: Norman Fritag | last post by:
Hi there, I have one subform in a Master form, which is set to add mode only. I allow only for data entry. Sofar all words fine. All information on the main form is set for display only and have...
6
by: Susan Bricker | last post by:
Hi. I have a subform that has a field (textbox) based on an integer field in a record. In ADD (NewRecord) mode, I want to prefill the field with the next available integer and not allow the...
15
by: Susan Bricker | last post by:
Greetings. I have a Mainform with a subform. The Mainform has single record format and subform has continuous form format. When the Mainform opens, I force allowadditions and allowedits to FALSE...
17
by: perryche | last post by:
I have 5records, e.g. Rc1, Rc2, Rc3..., when user open up a form, I want it to open to a particular record (say Rc3) then when user chooses the Record Selector , it will go to Rc2 and , it will go...
2
by: Shannan Casteel via AccessMonster.com | last post by:
I have a subform for listing parts. It has fields including: ClaimID, ITEM, NET PRICE, LIST PRICE, Quantity, Supplier, and a calculated field called Part Total. The subform is based on a query. ...
3
by: bruce | last post by:
Hello, I am trying to figure out how to use a class with a custom event as a wrapper for a subform so that I can automatically trigger things to happen on the parent form when the custom event...
6
by: lorirobn | last post by:
Hi, I have a form with a continuous subform. I am working on putting validations in for the subform's required fields. Being somewhat new to Access (or rather, an antiquated mainframe...
18
by: Drayno241 | last post by:
I'm working in access 2002. I have three tables : 1- District Data (Student ID, name, grade, etc) 2- Rosters (RRec ID,Campus, Teacher ID) 3- Students on Roster(SRec ID, RRec ID, Student ID) ...
1
by: maciejfr | last post by:
Hello everyone, My problem is updating Subform filter by onchange event in one of main form field I've got following: Me!.Form.Filter = " = "" N "" OR ( = ""T"" AND notanr = " & Me!nrnoty...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
1
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
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,...
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...

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.