• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

Can't set Value of DTPicker

I have tried setting the value of the DTpicker at runtime using the following statement in the Form_Load procedure:
           me.ctlDate.value = Now

I get the error message:  Runtime Error :'2763'  An error occurred in a call to the Windows Date and Time Picker Control

I have downloaded the latest version of the .ocx file and made sure it was registered correctly.  I have read all the other threads and most of them state that if you put the statement in the Load procedure and use the above syntax, it should work.  I don't understand why my control isn't working.

I am using this control on a switchboard and therefore do not want or have the ability to assign it's control source to a field in a table.  I thought about using a subform that has a date field that is defaulted to the current date and use it as the source but I have no way of linking the parent form to the subform.

Please help - I don't have time on this project to get hung up on this control!

Thanks!

I have since narrowed it down to having something to do with filtering the form at runtime.  When I comment out the code that filters the recordset and turn on filtering for the form, it works fine.  When I put it back - get the message again.
0
sgrice
Asked:
sgrice
1 Solution
 
sgriceAuthor Commented:
I have fixed the problem.  I tried just setting the record source at runtime and that didn't work until I changed the Record source property of the form to a SQL statement for the initial switchboard.  Something about the record source just being the underlying table then changing the recordset at runtime prompted the error message.  I'm clueless as to why but it's fixed now.  Hope this helps someone else.
0
 
moduloCommented:
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now