change layout upon navigating

J

Jean-Paul

Hi,
I have this small problem
I open a form and depending on the value of a checkbox, fields are
visible of not.
When I change the value from false to true, the fields are displayed as
they should, whenI change it again to false, they are hidden, so this is OK
There is a navigation button to go to the next or the previous form in
the recordset.
So, when I go from one record to the next one, the program should see if
the value is true or false and display the fileds or hide them.
How can I make this work?
Thanks
JP
 
M

Marshall Barton

Jean-Paul said:
I open a form and depending on the value of a checkbox, fields are
visible of not.
When I change the value from false to true, the fields are displayed as
they should, whenI change it again to false, they are hidden, so this is OK
There is a navigation button to go to the next or the previous form in
the recordset.
So, when I go from one record to the next one, the program should see if
the value is true or false and display the fileds or hide them.


You need to eun the same code from the form's Current event.

If it's just one or two lines of code, you could just
Copy/Paste them from the check box's AfterUpdate event
procedure. If there is a substantial amount of code or just
to avoid duplicated code, create a private Sub to make the
controls visible or not and then call the sub from both the
AfterUpdate and Current events.
 

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