Tab Control refreshing

Scott Heslop

Registered User.
Local time
Today, 23:55
Joined
Aug 29, 2012
Messages
17
Hi,

I have 2 issues. I am new to vba coding and i am creating a new training management database for a colleague. Firstly i have a tab control which has 2 tabs, a required course tab which is a list of the courses that a enployee needs to take and i have a course dates tab which is the dates that they have undergone the training courses that they require. What i want to happen is that if i change a required courses and i click back onto the course dates, i want to see the dates in that tab. Because currently i have a label.visible = false if the employee do not require that training course. If i press the ok button and then go back to the employee record it updates but if i click between each tab it doesnt update untill i press ok then open it back up again.

My other issue is if they dont require the course and the fields arent visible is there a way of moving all the visible field up to the top in line to make it look professional as currently it looks rubbish?

Has anyone got a suggestion of what code i need and where i need to put it?

Thanks

Scott (VBA Apprentice) haha
 
Note that controls on tabs are merely controls on the instant form. Tabs merely display/hide form controls based upon which tab is selected. Hide or display controls as required based up which tab is selected (has focus).
 
Ive tried a me.refresh on the on click event of the tab i want to refresh but this doesnt seem to work. What do you suggest i do to get this working how i want it then?
 
Hi,

I have 2 issues. I am new to vba coding and i am creating a new training management database for a colleague. Firstly i have a tab control which has 2 tabs, a required course tab which is a list of the courses that a enployee needs to take and i have a course dates tab which is the dates that they have undergone the training courses that they require. What i want to happen is that if i change a required courses and i click back onto the course dates, i want to see the dates in that tab. Because currently i have a label.visible = false if the employee do not require that training course. If i press the ok button and then go back to the employee record it updates but if i click between each tab it doesnt update untill i press ok then open it back up again.
I think you could call a Refresh or Update when you click on the date tab.
My other issue is if they dont require the course and the fields arent visible is there a way of moving all the visible field up to the top in line to make it look professional as currently it looks rubbish?

Has anyone got a suggestion of what code i need and where i need to put it?

Thanks

Scott (VBA Apprentice) haha
You should not be hiding or showing fields to do this. You should use a query with a continuous form. And a Yes/No field as a check box to indicate whether the course is needed or not. Then only show the fields that are checked. With a criteria in the query of the course query and the Required field = "Yes" or -1.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom