Select entry from combo box if yes/no box checked

lyatri

Registered User.
Local time
Today, 08:37
Joined
Dec 6, 2012
Messages
14
Hi All
I have a yes/no tick box on form this then enables two combo boxes. I also want it to change the value in one of the combo boxes. If you were to code that value as default it would be value "1". I have played around with item data and value but to no avail. Current code associated with check box is:

Private Sub FL_Trim_AfterUpdate()
If Me![FL Trim] = True Then Me![FL Lesion].Enabled = True
Me![FL Treatment].Enabled = True
End Sub

This currently works to enable the boxes but obviously not to change the value of FL Lesion.

Thanks
 
Will it always be the same value? If so do this:

Private Sub FL_Trim_AfterUpdate()
If Me![FL Trim] = True Then
Me![FL Lesion].Enabled = True
Me![FL Treatment].Enabled = True
Me![FL Lesion] = 1
End If
End Sub

NOTE: You need to change the 1 to the required value.
 
Thanks for your reply.
Unfortunately this doesn't solve the issue when I used code:
Me![FL Lesion] = Trimmed
which is the value I want the box comes through as blank
if out on interest i put = 1 is comes up as 1
 
What is Trimmed?
Is it a string, if so it needs to have quotes as follows:
Me![FL Lesion] = "Trimmed"
 
Not sure if I could actually understand what you mean.. But by what I have understand, the choice of Event might be the problem.. Try Form Current..
 
Apologies as I had set field as lookup in both form and table it as interfering now works. Thanks
 

Users who are viewing this thread

Back
Top Bottom