Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

2 easy ones (famous last words)

Posted on 2014-11-02
5
Medium Priority
?
174 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 600 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 1400 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

722 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