Enable Field if selection is "No"

Paul Cooke

Registered User.
Local time
Today, 18:00
Joined
Oct 12, 2001
Messages
288
I have entered some code on after update of field "Conwork" which enables the field below "disposal" to be enabled. After entering information the "disposal" field i press a button to save and print a report. before the report prints a window appears call "disposal1" if I enter any information in this window it is printed on the report. If i simply press ok or cancel this window the report is printed but the "disposal" field is blank.

The Code I have used is in the After Update selection on "Conwork" and is follows:

Private Sub Conwork_AfterUpdate()
If Me.Conwork = "No" Then
Me.disposal.Enabled = True
Else: Me.disposal.Enabled = False
End If

End Sub

Any help would be gratefully recieved!!
 
Sounds like your report is looking for a field called disposal1. It should be referenced exactly as the same name on the datasource.

See if you have a typo.

Doesn't seem that your enable/disable is the culprit here.
 
Thanks for the reply.

I have checked the spelling and it is all correct any other ideas?

Paul
 
Remove the colon from your Else statement:

Else: Me.disposal.Enabled = False

should be

Else Me.Disposal.Enabled = False
 
Thanks I tried tahe and when I moved to the next line it automatyically put the : back in after Else?
 
Where does the "No" come from? If it's a check box then it's No without quotes.
 
Hi Rich,

It's a dropdown box with a choice of Yes or No. I have posted the question again today but made it a bit clearer (I think!) I would be grateful for any help you could offer

Thanks
 

Users who are viewing this thread

Back
Top Bottom