- Why not try the On_Change of the form. This has one drawback because this
is also fired when the user goes to a previous record.
- You could also try placing all your checkboxes in a Option Group and place
a check on the Before_Update of the form to check the value of the
Optiongroup. Based on that outcome you can take the action you want.
- Or you can place a "check" in the tag of the checkboxes and loop through
the controls by checking the tag of the controls. If they match take the
required action else do nothing.
hth
Maurice,
Thanks for the tips. I can't seem to find the On_Change event for a form
(the helpfiles only have that for text and combo boxes). Also, unless I'm
reading it wrong, an Option Group can only have one thing selected in it.
The user for my form needs to be able to check multiple checkboxes (a
building could be used in several different time periods), my bad on not
explaining that in the first place.
I haven't used tags before (this is my first big db project). I'm a little
confused as to what sort of check this would be and when I would execute it.
Thanks again
> - Why not try the On_Change of the form. This has one drawback because this
> is also fired when the user goes to a previous record.
[quoted text clipped - 26 lines]
> > Any ideas? If there's a better way of doing this, I'd appreciate it too.
> > Thanks!
Maurice - 01 Jun 2007 18:20 GMT
Hi Shaun,
The On_Change should be On_Current, my mistake sorry. But you are correct
when stating that in an option group you only can select one item. So this
option is no good for you.
The tags...
Every control has a tag. It's a property where normally nothing is stored
but you can use it. Because you can use it many people do.
So for instance: a textbox has properties (i assume you know how to get
there but just to be sure - rightclick on control in designview and choose
properties)
Now look for the option 'Tag'. I have to say that this is the English word
for it. Depending on your Office lanuguage this might differ. (if you check
the 'other'-tab it is at the bottom).
What you can do is place the word 'chk' (without the quotes) in the tag of
every checkbox.
Now in code write the following for the form:
private sub Form_AfterUpdate
dim ctl as control
'-> Loop through controls
for each ctl in me
if ctl.tag ="chk" then '-> check to see if there's something in the tag
[do your action here...]
end if
next
end sub
hth

Signature
Maurice Ausum
> Maurice,
>
[quoted text clipped - 40 lines]
> > > Any ideas? If there's a better way of doing this, I'd appreciate it too.
> > > Thanks!
Shaun - 01 Jun 2007 18:37 GMT
I've already got something in the On_Current controller (loading up the
current record's checkboxes).
I'm already doing something similar to the tags with the names of the
checkboxes ("Name" LIKE "Era*"), so I don't think that's going to solve the
problem either. Also, you placed the code for that in the "AfterUpdate"
event controller. The event doesn't happen because the checkboxes aren't
bound to a record so no update is taking place.
Is there a way to tie the checkboxes to the linking table so that it knows
an update is needed?
> Hi Shaun,
>
[quoted text clipped - 78 lines]
> > > > Any ideas? If there's a better way of doing this, I'd appreciate it too.
> > > > Thanks!
Maurice - 02 Jun 2007 08:33 GMT
I get your point. Why not just place a button with the text &Save or
something like that. That way you have control of whenever the action needs
to be taken.

Signature
Maurice Ausum
> I've already got something in the On_Current controller (loading up the
> current record's checkboxes).
[quoted text clipped - 90 lines]
> > > > > Any ideas? If there's a better way of doing this, I'd appreciate it too.
> > > > > Thanks!