Tab Pages

Keith

Registered User.
Local time
Today, 13:06
Joined
May 21, 2000
Messages
129
Is it possible to make a tab page on a form visable or not, depending on the result of of an unbound option group on the same form?
I hope that this makes sense.
Keith
 
Hi Kieth

Yes it is possible.

In the "AfterUpdate" event of the Combo box put coding along these lines:

If cboMyCombo = "Value1" Then
Me![pagMyTab].Visible = False
Else
Me![pagMyTab].Visible = True
End If
Me.Refresh

If your Combobox is bound to a field then you would need to put the same coding into the OnCurrent event of the Form.

HTH

Rich
 
Hi again Keith!

Don't know why I thought you wanted to use a combo box ... but the same applies to an option group I think! The techinque definitely works ... you would just need to change the control.

HTH

Rich
 
Hi Rich

Sorry I could not get it to work.
I have a form with 5 tab pages on it. One of the pages is called "Hotel Details" on it is a subform 'FrmHotelDetails' I have an option group called 'ITX' with two buttons 'yes' or 'no'. If 'No' is selected I want to blank out the 'Hotel Details' page.
I'm a novice when it comes to code. Can you suggest another solution please?

Keith
 
Hi Kieth

Without coding - I don't think it is possible. Coding is a bit daunting initially but if you give it a try it will usually prove worhwhile in the long term.

If your option group has Yes or No, then probably the value is either 1 or 2.

Select your option group in Design View. Click on Properties (right button on mouse) and on the Tabs for Properties select Event. From this shorter list of Properties select After Update and choose Code Builder.

Your coding should then be as follows

Private Sub IXT_AfterUpdate()

If IXT = 2 Then
Me![Hotel Details].Visible = False
Else
Me![Hotel Details].Visible = True
End If
Me.Refresh

End Sub

Another bit of advice, Kieth. You ought to consider following the L&R naming convention for all your objects - see any decent book on Access for the suggested tags etc (usually postings on this kind of advice forum follow such conventions - believe me it makes life easier in the long run).

HTH

Rich
 

Users who are viewing this thread

Back
Top Bottom