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 Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide a Form Field based on entry in another Form field

Status
Not open for further replies.

endoflux

Technical User
Aug 6, 2001
227
US
I'm selecting a Country name on a Main from and choosing another form to pass that value to. This form is used to dispay business attributes for the chosen country, and some fields do not apply to certain countries.

I would like for the destination form to show/hide specific fields based on the country chosen; easiest way to do this?

Thanks!
 
endof,
In the "On load" event of your destination form:
(Remember, the text in quotes is case sensitive.)

Code:
Select Case Form!myform![country]
Case "Mexico"
forms!myform![textbox1].visible = false
forms!myform![textbox2].visible = false
Case "Canada"
.
.
.
Case "Denmark"
.
.
.
End Case

if you want to make them visble again when you exit.
in the OnExit event of the form, reset them to visible with the same code, only true...
Code:
forms!myform![textbox1].visible = true
forms!myform![textbox2].visible = true

jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top