Solved

Calendar Control not working when in a Tab Control

Posted on 2004-08-22
8
263 Views
Last Modified: 2012-05-05
For some reason, my Calendar control doesn't work when contained within a tab control. I have date fields within Tab Pages that when clicked, should call a Calendar control to select a date and enter it in the text field. However, this doesn't work. Can one of you Experts please help? Many kind thanks in advanced!
0
Comment
Question by:John Account
  • 5
  • 2
8 Comments
 
LVL 8

Expert Comment

by:dkmj17
ID: 11865373
Please explain a little more if you could... is the calendar control on a second form?  If so, is the problem that the form won't open?  If the calendar control is on the main form, is it made visible?  If so, is it behind the tab control and therefore, while visible, still not viewable?

Mike
0
 

Author Comment

by:John Account
ID: 11865460
Okay, Mike, thanks. Here's more explanation: There are 5 Calendar controls on the same form: 3 are contained within a page of its Tab Control, and the other 2 are on the form, outside the tab control. The two that are not in the tab control work like they're supposed to, but not the three within the tab control. Moreover, before adding the tab control to the form, all 3 Calendar controls worked just fine. I've increased the points to 350. Many kind thanks in advanced. Below is the source code:

Private Sub Calendar1_Click()
txtUserChg = SignedInUser
txtDateP2PEntered = Now()
txtPTPDATE = Calendar1.Value
txtCheckNum.SetFocus
Calendar1.Visible = False
End Sub

Private Sub Calendar2_Click()
txtDATE = Calendar2.Value
Me.txtTime.SetFocus
Calendar2.Visible = False
End Sub

Private Sub Calendar3_Click()
txtDaterec1 = Calendar3.Value
Me.txtAmount1.SetFocus
Calendar3.Visible = False
End Sub

Private Sub Calendar4_Click()
txtDATEVER = Calendar4.Value
txtTAPE.SetFocus
Calendar4.Visible = False
End Sub

Private Sub Calendar5_Click()
  Me.txtSentCD = Calendar5.Value & " - " & Format(Now(), "hh:mm:ss")
  Me.txtAmount1.SetFocus
  Me.Calendar5.Visible = False
End Sub
0
 

Author Comment

by:John Account
ID: 11865478
Also, it's not behind the tab control, nor any other controls, therein, so that's not an issue. It is invisible, initially, by made visible once clicked, as the code, in previous submission, illustrates.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 27

Accepted Solution

by:
jjafferr earned 350 total points
ID: 11865699
Hi Jhon,

Why don't you try to put the full path to the Tab (Tab Name) when calling the calendar control, for example:

txtPTPDATE = Calendar1.Value

should be

txtPTPDATE = Forms![YourMainForm].Form![Page41].Calendar1.Value

Where Page41 is the Tab Name

jaffer
0
 

Author Comment

by:John Account
ID: 11865785
I get the following error, when I try that, Jaffer:
Run-time error '438': Object doesn't support this property or method.
txtPTPDATE = Forms![Collections Admin].Form![PgSales-Verified].Calendar1.Value
0
 

Author Comment

by:John Account
ID: 11865837
Hey, Jaffer--I'll be damned...apparently it's suddenly working. I don't know what was wrong, maybe a typo in my code or something, but all is well now. Thanks!
0
 
LVL 27

Expert Comment

by:jjafferr
ID: 11865935
I guess its my lucky day with you, answering 3 questions of yours.

thanks for the points and the grade

jaffer
0
 

Author Comment

by:John Account
ID: 11866306
You're most welcome, Jaffer--Thank you! And, hopefully, you will answer more questions from me in the future...as I have many questions and you, apparently, have many answers. You know Access very well. I haven't touched it in about a year--and, even then, didn't know the answers to any of these questions you've been so kind enough to answer for me.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question