473,837 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TypeOf and Date Time Picker control

TD
This code doesn't work. Every posting I can find suggests that it
should.

If TypeOf controlname Is DTPicker then
do something here
End If

I am using the Date Time Picker control and wish to use TypeOf to
determine if the controlname is indeed a Date Time Picker control.

Any idea why this doesn't work?

Thanks,
TD

Nov 13 '05 #1
3 5251
The date time picker is not a native Access control.

Try using the ControlType value, e.g.:
Debug.Print Forms!Form1![YourDTControlNa meHere].ControlType

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"TD" <dl**@adsi-sc.com> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...
This code doesn't work. Every posting I can find suggests that it
should.

If TypeOf controlname Is DTPicker then
do something here
End If

I am using the Date Time Picker control and wish to use TypeOf to
determine if the controlname is indeed a Date Time Picker control.

Any idea why this doesn't work?

Thanks,
TD

Nov 13 '05 #2
You have to reference the Object property in Access

e.g.
If TypeOf Me.DTPicker0.Ob ject Is DTPicker Then
Debug.Print "Yes"
Else
Debug.Print "No"
End If
--
Terry Kreft
"TD" <dl**@adsi-sc.com> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...
This code doesn't work. Every posting I can find suggests that it
should.

If TypeOf controlname Is DTPicker then
do something here
End If

I am using the Date Time Picker control and wish to use TypeOf to
determine if the controlname is indeed a Date Time Picker control.

Any idea why this doesn't work?

Thanks,
TD

Nov 13 '05 #3
Allen,
All the controltype property tells you is that it is an ActiveX control, not
which ActiveX control is held in the Access control. You need to check the
Object property of the control to test this.

e.g.
If TypeOf Me.DTPicker0.Ob ject Is DTPicker Then
Debug.Print "Yes"
Else
Debug.Print "No"
End If
--
Terry Kreft


"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:43******** *************** @per-qv1-newsreader-01.iinet.net.au ...
The date time picker is not a native Access control.

Try using the ControlType value, e.g.:
Debug.Print Forms!Form1![YourDTControlNa meHere].ControlType

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"TD" <dl**@adsi-sc.com> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...
This code doesn't work. Every posting I can find suggests that it
should.

If TypeOf controlname Is DTPicker then
do something here
End If

I am using the Date Time Picker control and wish to use TypeOf to
determine if the controlname is indeed a Date Time Picker control.

Any idea why this doesn't work?

Thanks,
TD


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
7110
by: Adrian Parker | last post by:
Hi. I have a date time picker in my program which uses ADO to read from an Access database. It works perfectly, unless the database is empty (no records) when opened. When you try to open an empty database, the date time picker returns error 545. Any attempts to progmatically add new records after the empty database has been opened returns, or to use the DTP and set a new date for those added records, "Field not updateable, Bound...
13
3104
by: Deano | last post by:
Hi, I generate a report using two dates (From and To). I notice if I enter 01/10/2003 that it is interpreted by Access as 10/01/2003 i.e 10th January rather than 1st October as I intended. This is the old problem of US date format mm/dd/yy versus dd/mm/yy. I am stepping through the code and the dates do seem to be ok but when the report runs I get records earlier than 1st October which is not what I want.
2
3958
by: Need Helps | last post by:
The example given in msdn.com on how to create a Date Time Picker involves using the CreateWindowEx function. However, I created a dialog box using the graphical interface, and then used the graphical interface to add a Date Time Picker control to it. The only problem is, I don't know how to do anything with the Date Time Picker, like access the date selected within the control. All I have is the ID, which in my code is IDC_DATETIMEPICKER1. ...
4
2674
by: Michael Turner | last post by:
Hi Guys I have two DateTime pickers one shows the Date and the other the time, this is a requirement of the solution. The problem I have is that when the time is saved to the sql database into a datetime field it uses the default date which is a problem when I try to sort, what I wanted to know is there a way for me to set the date in the time picker to the date in the date picker? Any help greatly appreciated.
2
2422
by: Darhl Thomason | last post by:
I'm converting my Access 2003 VBA app. I have a number of date fields in my db that I want to use the date/time picker control with, but if there is no entry in my database, I want the date/time picker to show no date. Right now the first time it shows a blank date record, it inserts today's date. But as I move through the db and it finds a date in that field, the next time it finds a blank data record, it uses the last one as the...
4
4882
by: Michel Posseth [MCP] | last post by:
I have a problem with the date time picker validate event wich i believe is a bug How to reproduce : throw on a form a date time picker control and a textbox control select the validating event of the control and add this code
3
5978
by: luanhoxung | last post by:
hi all ! i have a date & time picker control bound to 1 field. it worked fine. But i always get the message :" Can't set value to Null when checkbox properties = FALSE" when i open my form. there isnot any checkbox or proceduce on my form. if the D&T picker control is unbound to any field, no message appear. Can anyone explain to me what is trouble ? Thanks ur time visitting my post. Luan from VietNam
0
2847
by: fredloh | last post by:
i have a tab control on my form. i then have several microsoft date and time picker control on the tab control. when i select a date on any of the date and time picker control, the result of the control's value is always 12:00:00 am instead of the date i selected even though the date displays correctly on the date and time picker control. the controls are unbound. why is this? i also have another identical form where the date and...
1
4468
by: Sabbuser | last post by:
Hey Guys please help me out!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I have placed a Date & Time Picker Control on a form in Windows 2000, When our Organization has upgraded all the PC's with Windows XP. Now i can't find the Date&Time Picker Control on the Form, it is showing a blank box. I have visited the Microsoft website, there i found that "Date&Time Picker Control has been eliminated in Windows XP".
0
9843
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10875
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10623
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7001
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5848
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4040
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3124
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.