Hiding a control based on the value of a cbo box column

K

Kevin C Niven

On a from, I want to hide a subform if [cboMyBox].[column](3) is 0.

How do I write the VB code and where do I put it?

I would think this would be easy, but I have tried many different ways
of writing the code in the OnLoad event and nothing works. Perhaps
I'm in the wrong event.


Many thanks,
Kevin
 
K

Kevin C Niven

Kevin,

Try code like this in the On Current event of your form and in the After
Update event of your combo box:

If Me.cboMyBox.column(3) = 0 then
     Me.NameOfSubForm.Visible = false
Else
     Me.NameOfSubForm.Visible = true
end if

Great, On Current worked. Thanks very much.


Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top