Group control on form doesn't work

odrap

Registered User.
Local time
Today, 20:38
Joined
Dec 16, 2008
Messages
156
i like to use a form to manage clients and ex clients. With this goal i have a group control on my form with the following code:

Private Sub GrpKeuzeKlant_AfterUpdate()
If GrpKeuzeKlant = 1 Then
Me.Filter = "me!chkboxExKlant = 'False'"
Else
Me.Filter = "Me!chkboxExKlant = ' True'"
End If
If Not Me.FilterOn Then
Me.FilterOn = True
End If
End Sub

The chkboxExKlant is a checkbox on the form that is bound to the field exklant in my tblClients.
Each time i make a choice in the group control , i get the message
Give parameter chkboxExKlant.
What am idoing wrong?
 
I belive that your filterstring is wrong, try

Code:
Me.filter = "((tblClients.chkboxExKlant=True))"

JR
 
Thank you for the help, but unfortunatly, the problem remains the same.
Any other suggestion ?
 
If you are using the Option Group as a genuine option group (meaning that the user cannot checkmark more than one box) then you have to do the following.

(1) Set the default value for each checkbox - the first one will be 1, then 2, 3, etc.
(2) Set the default value for the Option Group whether 1, 2, 3 - this determines which checkbox will be checked at startup (I usually do this in the form_Load event by setting

optionGroup1 = 4 'or whatever number

(3) Your query should reference the option group, not the individual checkbox.

if optionGroup = 2 'then this means the second box was checked.
 

Users who are viewing this thread

Back
Top Bottom