Tab control question

  • Thread starter Thread starter Clay Forbes
  • Start date Start date
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?
 
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...
 
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
 
Back
Top