|
-
Jan 24th, 2006, 10:15 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] A quick date Picker Question.
Hello
In my VB6 program I have a text box that is populated by a date picker.
When the form loads the date picker is set to Now.
On the change event, of the date picker, I let the text box = date picker.value, however if the user clicks on todays date within the picker, which is the default value, the text box is not poplated. Anyway around this?
Thanks
Kev.
-
Jan 24th, 2006, 10:20 AM
#2
Re: A quick date Picker Question.
In the _CloseUp event procedure you can place the same code in there too to populate the textbox upon closing of the dtp.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 24th, 2006, 10:22 AM
#3
Thread Starter
Hyperactive Member
Re: A quick date Picker Question.
Thanks RobDog888, works like a charm.
Kev.
-
Jan 24th, 2006, 10:25 AM
#4
Thread Starter
Hyperactive Member
Re: [RESOLVED] A quick date Picker Question.
It's an optional field used in a search, if the text box is empty then no date in the search criteria.
Kev.
-
Jan 24th, 2006, 10:27 AM
#5
Re: [RESOLVED] A quick date Picker Question.
The dtp also supports Null dates. Set the CheckBox property to True. There will appear a small checkbox on the left side of the dtp. If they select a date then its checked. If they dont want a date then unchecked it. No textbox needed then
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 24th, 2006, 10:29 AM
#6
Re: [RESOLVED] A quick date Picker Question.
 Originally Posted by Kev
It's an optional field used in a search, if the text box is empty then no date in the search criteria.
Kev.
If you put a msgbox in the Change event, and click on today's date, the message box isn't displayed. For some reason, when you select today's date, the change event doesn't fire. I think it is because the date picker doesn't recognize today's date as a Change.
Anyway, I usually place today's date in my textbox in the Form_Load. That way, if today's date is desired, no selection needs to be made.
-
Jan 24th, 2006, 10:34 AM
#7
Thread Starter
Hyperactive Member
Re: [RESOLVED] A quick date Picker Question.
I didn't know about the check box property and Null dates, thanks again.
Hack, the reason I leave the text box empty is that todays date is relevent in the search. I only want to use a date if the user enters one.
Thanks gain though.
Kevin.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|