Combo Box - Visible Property coding issue (1 Viewer)

Geezer

Registered User.
Local time
Today, 23:17
Joined
Jul 14, 2008
Messages
62
Have an unbound combo box which by default is not visible. When the user clicks on an "EDIT" button the combo box becomes visible using the following bit fo code:

Code:
Forms![Frm_Main]![Subform_Capacity].Form![Cmb_RangeSelector].Visible = True
The opposite happens if the record is changed (On Current) or the user clicks on a "LOCK" button:

Code:
Forms![Frm_Main]![Subform_Capacity].Form![Cmb_RangeSelector].Visible = False
The EDIT and LOCK buttons work fine, however using the same bit of code does not work in the On Current event. The odd thing is I have another similar combo box and it works fine for that one. Also if proceed to a new record and then go back the On Current events works. Clicking the LOCK button also doesn't work after changing records, but only on that specific unbound combo box.

Any ideas as to what's happening?

Thanks.
 

vbaInet

AWF VIP
Local time
Today, 12:17
Joined
Jan 22, 2010
Messages
26,374
The Current event of the subform or the parent form?
 

Geezer

Registered User.
Local time
Today, 23:17
Joined
Jul 14, 2008
Messages
62
The Current event of the subform or the parent form?

Parent form, have added it to the On Current event in the subform and it appears to be working now.

Thanks for the pointer, I'd still have thought though that having it run in the parent form would have been enough.

Anyhow......thanks for the reply.
 

Geezer

Registered User.
Local time
Today, 23:17
Joined
Jul 14, 2008
Messages
62
The Current event of the subform or the parent form?

Hmm, this works but I have a continuous subform so everytime I jump to the next record I need to unlock it first.

Have tried to run the code on some other events but it resorts to the original problem.
 

vbaInet

AWF VIP
Local time
Today, 12:17
Joined
Jan 22, 2010
Messages
26,374
Hiding the control in the Current event without any condition like IF this DO THIS is not logical. When you hide a control in a continuous form the control gets hidden across all records. That's just the way it is. So instead of hiding, Lock it.
 

Users who are viewing this thread

Top Bottom