Loop Through Records, Check Values of Check Boxes and Implement Code (1 Viewer)

isladogs

MVP / VIP
Local time
Today, 03:44
Joined
Jan 14, 2017
Messages
18,212
DaLoaf
I don't know whether you intended to delete this thread but as it had multiple and lengthy replies I have restored it. Even if no longer useful to you, it may well be useful to others in the future.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 03:44
Joined
Sep 12, 2006
Messages
15,651
Thanks for all the responses.

Yeah I'm self taught on VBA so sometimes I miss the easier solutions. MajP, what, you don't like my Rube Goldberg machine of coding? ;-)

Although I've been hesitant to use Dsum and Dlookup (for performance reasons), those do seem to be a much easier solution.

As far as the structure being an issue, it's not, but perhaps it would be easier to understand if I told you all that controls A-E are US States (which I renamed for this post).

So basically all I'm looking for is that if I check a state, let's say New York, in any sub-record, I just want the main record to reflect NY as well. And if NY is unchecked in any subrecord, as long as it's not checked in another subrecord, it would uncheck on the main form.

I think the Dsum/Dlookup route is going to be the best approach for this and I appreciate everyone's help.


This may have been pointed out by others - the real point is that if your main record is a record for NY, then your sub records shouldn't be allowed to be anything other than NY, or your model is wrong.

The sub record DEFINITELY should never cause the parent record to be changed.
 

Users who are viewing this thread

Top Bottom