Combobox word make checkbox Yes

B

BMBerna

In access 2007, I have a combo box (cboAgencyStatus) on frmConsumers
that when the word discharge is selected it would make the hidden
checkbox (chkDischarge) Yes.

How can I do this?
 
R

Robert_DubYa

Not sure exactly what you are alluding to. If the user clicks on the word
"discharge" or if discarge appears in combo box?

From the sounds of things you will need to do some VB coding. Not sure if
you are comfortable with that or not. Also, as a matter of design you may be
saving the same information in two seperate tables (if so that design could
prompt future errors).
 
B

BMBerna

Basically if the user selects discharge in the combobox it will make
the checkbox true/Yes. They will be saving under two different areas
in the table. One for the yes/no and the other for general status. In
the end, what i want to do is when the checkbox is selected it will
move the consumer to a different table because they will be unactive
in the database but I can't delete the consumer because he could
return.

Does that help? I know very little coding
 
B

Beetle

Coding the combo box isn't difficult. Use the After Update event with code
similar to the following;

Private Sub cboAgencyStatus_AfterUpdate()

If Me.cboAgencyStatus = "Discharge" Then
Me.chkDischarge = True
Else
Me.chkDischarge = False
End If

End Sub

The above code assumes that the column that holds the "Discharge" field
is the bound column of the combo. As far as moving the consumer info
to another table when they become "inactive", that may be unnecessary.
It would be simpler to base your form on a query with criteria like
inactive = false (assuming you have a boolean field in the table for
active/inactive).
 
B

BMBerna

The code is great thanks, but its failing on Me.chkdischarge=false.
When you sent it to a different status (active,waiting,on hold and
Pending) ,it goes into debugging.
 
B

BMBerna

The code is great thanks, but its failing on Me.chkdischarge=false.
When you set it to a different status (active,waiting,on hold and
Pending) ,it goes into debugging.
 
Top