Solved

2 easy ones (famous last words)

Posted on 2014-11-02
5
149 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
Comment Utility
> 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
Comment Utility
is that the only solution?
0
 
LVL 49

Expert Comment

by:Gustav Brock
Comment Utility
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
Comment Utility
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
Comment Utility
many thanks.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now