Tick Boxes

Rockape

Registered User.
Local time
Today, 14:07
Joined
Aug 24, 2007
Messages
271
Hi all,

I would be grateful for assitance: My problem is as follows:-

I have two fields A and B formatted (as y/n)which need to be populated per record. I have inserted two option buttons to cater for these two fields, i.e. by ticking either box the value is saved in the record.

The conditions that I am trying to apply is :-
If A is ticked B cannot be ticked. If B is ticked then A cannot be ticked. However both can remained unticked.

I have looked into the idea of using an option group but it is causing me some problems and too much delay.

I was however thinking whether its possible to create an event procedure that I could add onto my "Add Record" that would add the record to the table so long as the conditions mentioned above are met. If so, what would be the code for such an event?


Thanks
 
I'd add some VBA behind the checkboxes.

chk1 & chk 2 are checkboxes for the two options for a single y/n field (I assuime this is what you mean):

chk1 After Update:
Code:
If chk1 = true then
    chk2.enabled = false
Else
    chk2.enabled = true
End If

Reverse the code for chk2 after update.

Ticking the checkbox should disable the other one, clicking it again to untick it should re-enable the other checkbox.

:edit:

Checking that one of the two checkboxes before adding the record is just a case of adding something like this before the addrecord vba:

Code:
If chk1 = false and chk2 = false then
    MsgBox "Please enter a selection for *FIELD NAME*"
    Exit sub
End if
 
Thanks much appreciated...

I will try this out.

Regards
 

Users who are viewing this thread

Back
Top Bottom