Tab control question

C

Clay Forbes

Is it possible to have a tab control with a tab that is linked to a
report so that when the user clicks that tab it shows a report. I know
this is possible with a cmd button, but how do i do that with a tab
control?
 
R

Rick Brandt

Clay Forbes said:
Is it possible to have a tab control with a tab that is linked to a
report so that when the user clicks that tab it shows a report. I know
this is possible with a cmd button, but how do i do that with a tab
control?

A bit unorthodox, but you would use the Change event of the TabControl
itself and test to see which TabPage had been selected. For example, if
the index of the desired TabPage was 3 then you would use something similar
to...


If TabControlName.Value = 3 Then DoCmd.OpenReport...
 
J

John Spencer (MVP)

Yes, it is possible. You would need to use the OnChange Event of the tab
control and the tab control's value property. Tabs are zero-based, so the first
tab is 0, the second tab is 1, etc.

Your code in the event would look something like:

If Me.YourTabControl = 2 Then
DoCmd.OpenReport "WildAndCrazyGuyReport"
End if
 

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