hide a combo box

Fugan

Registered User.
Local time
Today, 17:23
Joined
Aug 7, 2006
Messages
16
hello,
i'm trying to make the combo box hide after i choose one out of combo
box, eg: i have in combo box 1,2,3,4,5,6 and when i choose 4 i want it to hide
i have tried

me.nameofcombobox.Visible = False

but does not work because it has the Focus so i tried

me.nameoftextbox.SetFocus
me.nameofcombobox.Visible= false

but it comes up saying

Run time error '2108':

You must save the field before you execute the GoToControl action,
the GoToControl method, or the SetFocus method.

i don't no what to do can someone help me plz
___________________
David
 
If the Combo box is bound, it needs to be unbound.
If the information in it is static you can use a value list instead.
 
jkl0,
hello i tryed making it unbound and tried

me.nameoftextbox.SetFocus
me.nameofcombobox.Visible= false

comin up with same crap as before You must save the field before you the GoToControl method, or the SetFocus method. execute the GoToControl action,

does not work and

me.nameofcombobox.Visible= false

comin up with same crap as before You can't hide a control that has the focus

all i want it to do is when i choose one from Combo box for it to hide
this is realy give me the shits i can not work it out ty for trying
if anyone knows what i need to be doing plz plz plz plz plz plz plz help
i have been trying to work this out for days now
 
Last edited:
Perhaps, when you make a selection, you can move it to a variable or an unbound field and move to the next field. Then, run the code that checks the value in the variable and, if it is 4, run the visibility property code.
 
grnzbra,
thing is when i choose one from the Combo box it is unhiding other fields and i want the fields to be wre the Combo box is,
so i want to have a field hiden behind it and when i choose one from Combo box i want it to make that many textboxs visible i have got the field to unhide but i realy need the combo box to hide after i choose one, so i no i need to some how to make it focus on somthing else but it does not seem to like
setfocus to anything else there must be a way i can do this
it will look crap if i make it when i choose one then have to click on something else to make it hide

ty for trying to help
__________
David
 
Last edited:
If you create an extra text box to hold the value from the combo box as I described above, you could make it with 0 dimensions and transparent boarder so that it is not visible. Then when the selection is made, move the focus to the text box. Then, in the new text box, code your if statement to decide if you want to hide the combo box. If so, hide it and set focus to the text box that is behind the combo box.
 

Users who are viewing this thread

Back
Top Bottom