unhiding and rehide tab on tabbed form

T

tonkaplayer

I have a glorified excel that is wanted in access. One large table with
student number student name, so on. alos in this table is parking sticker
one, (then fields for vehicle 1 info year make etc.), parking sticker
two(then fields for vehicle 2). Show as not to show all this at once since
two vehicels is rare but happens enough, I would like to have a tabbed form
and put vehicle two in the second tab. I am ok up to here. I would like to
have tab two invisible unless needed such as when a second parking sticker is
issued to one student. They drive moms then dads car. Now having said all
this I can hide tab tow in properties I can even make it visible by clicking
on a yes/no button. Problem comes when I go to the next record. I would like
the yes no button to reset to no and the tab to rehide itself. This assumes
of course the next student does not also have two parking stickers. So I see
an if then condition and some property settings. I need the property fields
when the record changes and the if then syntax. A lot I know any help or
good books on teh subject would be aprreciated.
 
D

Daryl S

Tonkaplayer -

Use the OnCurrent event to check this each time a new record is displayed.
You can use code like this (but use your control names):

If Me.Vehicle2 is NULL Then
Me.tabControl2.visible = False
Else
Me.tabControl2.visible = True
End If

You will need to allow the user to add a second car when there isn't one, so
you may want to add a button on the first form that is visible only when
Behicle2 is not null that will also make that tab visible so the user can
enter the second car.
 

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

Similar Threads

Data Refresh 3
Print tabbed form 7
tabbed forms - tab 3 link to tab 2 1
Tabbed Forms 2
Sync Tabbed Form 1
sync combox boxes 2
tabbed pages on form 2
Change existing form to tabbed form 1

Top