Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple control sources for ActiveX Calendar?

Status
Not open for further replies.

Atomsk

MIS
Jun 3, 2003
60
US
In other words, I have about 15 date fields in a page but definitely not enough room for 15 calendar controls.

The way I've arranged them is so that they all surround a single calendar control. I'd like to make it so that tabbing through the fields displays their values in the control (works already) and, while a field is active, clicking in the calendar control will change the value for that specific field only and change the calendar display accordingly. Is this possible? Thanks.
 
Hi Atomsk,

Paste this into the On Click event of your Calendar Control:

On Error Resume Next
If Screen.PreviousControl.Tag = "Calendar" Then
Screen.PreviousControl = Me!CalendarControlName
Screen.PreviousControl.SetFocus
End If

Set the Tag property for all the Text Boxes that you want updated by the Calendar control to: Calendar

Bill
 
Is this VBA? This is a web page, as I see I forgot to mention, so I'm using VBScript. It doesen't seem to give me any errors if I put it like this:

On Error Resume Next
If Screen.PreviousControl.Tag = "Calendar" Then
Screen.PreviousControl = ActiveXCtl0
Screen.PreviousControl.SetFocus
End If

However, I can't seem to find the "Tag property" for text boxes. I do see a "TagUrn", though that's probably not the same thing...Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top