Tab Control On Click Event

S

SITCFanTN

I think this must be so simple because I can't find any other posts on this
exact topic so I appreciate any help you can give me.

I have a form with tab controls on it. What I want to accomplish is when a
tab is clicked, have the tab name fill in the "TASKID" field in the table
"tblQAData" for that record. One of the tabs is titled "Balancing". The
field "TASKID" is a dropdown, will that cause a problem with coding this? Do
I need to add the "TaskID" filed to the tab sheet to get it to prefill when
the tab is clicked or record saved? Any help you can provide is appreciated.
Thank You
 
D

Dale Fye

Try using the tabs Change event rather than the Click event.

You will then have to write some code that does what you want based on the
Value of the Tab control. Something like:

Private Sub tab_MyTab_Change

Select Case me.tab_MyTab.Value
Case 0
'put some code here for the 1st tab
Case 1
'put some code here for the 2nd tab
Case Else
'put some code here for all other tabs
End Select

End Sub

HTH
Dale
 
S

SITCFanTN

I don't understand, how would the code look to prefill the field that I
originally mentioned in my original post? Thanks
 

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