Making a textbox visible on a form if a checkbox is checked on the same form (1 Viewer)

wehoscottward

Registered User.
Local time
Yesterday, 21:24
Joined
Aug 30, 2013
Messages
36
Hello.

I’m having a problem with making a textbox visible on a form if a checkbox is checked on the same form. I have done research on this site and have written the code below, but I’m getting a Syntax error—see yellow highlight.

· My checkbox is named: Case is a Readmission from WRCA IP to WRCA IP

· My textbox is named: Date of Current IP Admission (I have defaulted this textbox to not visible).

Here’s the code I have written:

Private Sub Case_is_a_Readmission_from_WRCA_IP_to_WRCA_IP_Click()
If Case is a Readmission from WRCA IP to WRCA IP =true then
Date of Current IP Admission.visible=true
Else
Date of Current IP Admission.visible=false
End If

End Sub

Private Sub Form_Current()
If Case is a Readmission from WRCA IP to WRCA IP =true then
Date of Current IP Admission.visible=true
Else
Date of Current IP Admission.visible=false
End If

End Sub

If anyone can help, I’d be very appreciative.

Many thanks,

Scott
 
Actually you're not far off. Because of the inadvisable spaces, you'll need to bracket your names.
 
Hi, Paul.

Thanks so much! I added brackets and it's working perfectly!
 
Happy to help. Spaces and symbols are really not worth the trouble in the long run.
 
Hi, Paul.

I've run into another snag. I want a lable (lable190 to appear when a checkbox is clicked. Here's the code I'm using, but I'm running into another error. The error message says "object required."

If [Case is a Readmission from WRCA IP to WRCA IP] =true then
Lable19.visible=true
Else
Lable19.visible=false
End If

Private Sub Form_Current()

If [Case is a Readmission from WRCA IP to WRCA IP] = True Then
[Lable19].Visible = True
Else
[Lable19].Visible = False
End If
 
Looks okay. Are you sure it isn't Label19?
 
Hi, Paul.

Correct--it's lable19 (no space), but for some reason the code isn't working and I get the following error message:

Run-time error '424':
Object required
 
Can you post the db here?
 
If we're talking about the label with "Calculate Community Tenure for IP to IP Readmits", it is named "Label19", as I suspected.
 
Hi, Paul.

I appreciate you working with me. I do have it written correctly in my code:

If [Case is a Readmission from WRCA IP to WRCA IP] = True Then
Lable19.Visible = True
Else
Lable19.Visible = False
End If

And it's still causing an error... What am I missing?
 
No, you have the "l" before the "e". See the difference?

Lable19
Label19
 
One last question--how do make it so my email address doesn't show to everyone.
 

Users who are viewing this thread

Back
Top Bottom