Solved

2 easy ones (famous last words)

Posted on 2014-11-02
5
169 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 51

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 51

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 85

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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

622 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