controlling data entry

G

Guest

i am new to access and would appreciate any help! i have designed a form for
data entry to be filled in by many other people. it is a simple tick box
form. however, the items in the form are grouped, and each group has a
tickbox which needs to be ticked if none of the items within that group are
present. i want to create a fool proof method where it is impossible to tick
any items as being present if the group box is ticked (meaning that none of
the items in that group are present). presently, it is possible to tick the
group box as well as for each of the items within that group which is
creating a conflict of data.
 
J

Jeff Boyce

It sounds like you are saying something like:
If the "group" box is "Yes" (i.e., checked), then disable the "group
item" checkboxes.

If that's what you are looking for, you could do it with "brute force" with
something like:

Me.chkGroup1_FirstItem.Enabled = Not (Me.chkGroup1 = True)
Me.chkGroup1_SecondItem.Enabled = Not (Me.chkGroup1 = True)
...

A slightly more elegant way would be to first evaluate the Group1 checkbox,
then use that, as in:

Dim blnGroup1 as Boolean

Me.chkGroup1_FirstItem.Enabled = Not blnGroup1
Me.chkGroup1_SecondItem.Enabled = Not blnGroup1
...

And an even more elegant way (provided you named the group members with a
"group" prefix, or you used the Tag property to add in group membership)
would be to create a procedure that cycles through all the controls on the
form, setting the .Enabled property of each group's members.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
G

Guest

Perhaps, my ignorance about access matters was unclear from my first post.
Also, clarifying, If there are 6 tick boxes in the form - what i want to do
is as follows - box 1 would have a default tick in it. if any of the other
boxes 2-6 are ticked, I want box no. 1 to automatically untick. Once I can
do that, I can duplicate the results, in the other groups.

Thanks for you help anyways!
 
P

Pieter Wijnen

in the afterupdate of box2-6 place:

Private Sub BoxX_afterUpdate()
me.box1.value = False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top