Solved

2 easy ones (famous last words)

Posted on 2014-11-02
5
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 50

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 50

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

752 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