Full Version: Tab Form Show/hide Calendar Control
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
dazcox
Hi All, I have a a form with a toggle button which displays a tab form with a number of tabs with details relating to the main form.

I have a calendar control on one tab which works fine on the first tab i put it on (click button and calendar appears, chose date and it disappears and populates the date field - fine) BUT the same code does not work on the second - I'm guessing its the way i reference it.

FIRST TAB CODE

Option Compare Database

Private Sub Calendar_Click()
Me.AbsenceStartDate = Me.Calendar.Value
Me.AbsenceDuration.SetFocus
Me.Calendar.Visible = False
End Sub

Private Sub CmdGetDates_Click()
Me.Calendar.Visible = True

End Sub

Second Tab code is the same but i have changed the name of the Calendar control to Calendar4.

Any ideas?
prebez
It sounds like the first control is on your main form. Controls on subforms should be referenced using the control name of the subform e.g: Me.MySubformControlName.Calendar. This applies to all controls.

Hope this was your problem

Jock
dazcox
Hmm, thanks for the reply, you have confirmed my suspicions. Back to the drawing board...
prebez
Your welcome. Good luck

Jock
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.