Hide Button/Fields in Form

Fozi

Registered User.
Local time
Today, 23:29
Joined
Feb 28, 2006
Messages
137
Hi

I'm trying to do what I beleive should be a simple routine. I wish to hide certain fields and buttons based on the contents of another field in the same form. So for example if the field has "Yes" in it these display if "No" then they are invisible.

Thanks
Fozi
 
something like this will work:

Code:
if field = "Yes" then
button.visible = true
field.visible = true
else
button.visible = false
field.visible = false
end if

the top field being where you select 'Yes' or 'No' and the comand and field being the opbjects you want to hide.
 
thanks Dave. My form shows continuous records. What event property should I insert this into?
 
This doesnt work properly (or as you would want) on continues forms (unfortunatly)...
 
seriously? It's impossible to do? How frustrating!
 
if you have continuous forms, then in theory the Oncurrent event property could would be the closest, but im not sure if you will need to refresh the form to do, but namliam may be right, it may not to anything.

If you have a button that will go onto the next record (say a next record button) a way to do this (maybe not the best way, but will work) is put that code in the onopen property (or onload property) and when you press the next button, close the form and reopen it at that current record. although, reopening it at the current record could be trickier
 
actually, i forgot, if you put the top code in to the combobox onchange event (where you would select either "Yes" or "No") then that will work!
 
The thing about continious forms is that the controls are basicaly one.
So if you show the control on 1 line, it is visible on all. or vice versa...
 
your last post not quite true
you need to play around with this
your cont.. form needs to be tied to a seperate table and on this table you need to hold the values y/n or true/false whatever

it can be done and i recommned you look at the samples under cont..forms for the full answer
I have done it but I have not got that version to hand where I did it

g
 

Users who are viewing this thread

Back
Top Bottom