Solved

2 easy ones (famous last words)

Posted on 2014-11-02
5
157 Views
Last Modified: 2014-11-03
Dear experts -
I have a multi-tab form, and I have two issues:
1) when I'm on tab 2 or 3, for example, there are just 1 or 2 fields from the underlying record on that tab (they're mostly filled with subforms). I want to update the underlying record with the data IN THAT FIELD that is being updated, without going through the form's Before Update event, which checks a lot of other stuff.
I then want to show that the record is not dirty.
What's the easiest way to do this?

2) Similarly, I have some subforms on these same tabs; I run certain procedures that update 1 or 2 fields in the underlying main record (the record that governs the parent form).
I want to update those fields, not hit the parent record's Before Update, and then show that the parent record is not dirty.

Thanks for any guidance!
0
Comment
Question by:terpsichore
  • 2
  • 2
5 Comments
 
LVL 49

Assisted Solution

by:Gustav Brock
Gustav Brock earned 150 total points
ID: 40418239
> I want to update those fields .. and then show that the parent record is not dirty.

Then you will have to have these as unbound controls, update the main record by an independent SQL or VBA update, and finally requery the main form.

/gustav
0
 

Author Comment

by:terpsichore
ID: 40418405
is that the only solution?
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 40418510
Don't know. But you can't edit any field (bound control) of the main record without making the main form dirty.

/gustav
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 350 total points
ID: 40419217
Only workaround I could suggest would be to set a Form-level variable in each of those controls where you do NOT want the validation to run, and then check the value of that variable in the Form's BeforeUpdate event. So if I have a Form-level variable named "fRunValidation", and a control name txCustomer, and I do NOT want to run the validation, I'd do this in the CONTROL's BeforeUpdate event:

fRunValidation = False

Then, in the FORM BU event:

If fRunValidation Then
  <your validation code here>
End If
'/ reset the variable
fRunValidation = False

You'd also want to reset fRunValidation in the Form's Current event, to "reset" the value each time you move to a different record.

As gustav has said, then only way to show a form being "not dirty" is to let Access run the full event stream.
0
 

Author Closing Comment

by:terpsichore
ID: 40419220
many thanks.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question