Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make a text box visible based on value entered in another box? 1

Status
Not open for further replies.

ulteriormotif

Technical User
May 18, 2003
79
NZ
I have a form for payments received. On each record there is a payment type textbox (combo) - eg, payments are received in installments, so options are submission, interim, final.

If 'final' is selected in that combobox, I want another field to appear in which they can enter data - information that only applies to final payments - but the second textbox should remain invisible otherwise.

I'm just not getting anywhere with searching for how to do this. Can someone get me started? Or better yet, finished? :)
 
ulteriormotif

Create two events - one for the forms OnCurrent record event, and the other for the Final field AfterUpdate.

Assumption
- Combo box called cmbPayment
- Name of field for "final" details called txtFinal

Code:
If Nz(Me.cmbPayment, "") = "Final" Then
    Me.txtFinal.Visible = True
Else
    Me.txtFinal.Visible = False
End If

Note that you can use this same trick to hide / unhide a subform.

Richard
 
The one line solution:
Me!txtFinal.Visible = (Nz(Me!cmbPayment, "") = "Final")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top