Results 1 to 10 of 10

Thread: dt picker

  1. #1
    Join Date
    Apr 2004
    Posts
    35

    Unanswered: dt picker

    Hi,

    I have in a form two dt pickers, one for begining date and the other ending date. I want to them to show today's day and to be unenabled each time the form is open.

    I have this code:

    Private Sub Form_Load()

    Me!dtBegDate.Enabled = True
    Me!dtEndDate.Enabled = True
    Me!dtBegDate.SetFocus
    Me!dtBegDate.Value = Now()
    Me!dtEndDate.SetFocus
    Me!dtEndDate.Value = Now()
    Me!txtName.SetFocus
    Me!dtBegDate.Enabled = False
    Me!dtEndDate.Enabled = False

    End Sub

    It occurs an error in line : Me!dtBegDate.Value=Now() - Run-error:2763:... An error occurred in a call to the Windows Date and Time Picker control..

    Can somebody help me??, I dont know what I am going wrong.

    Thank you
    MARGA

  2. #2
    Join Date
    Sep 2003
    Posts
    228
    I had no trouble with your code.
    If you go into the VBA window. Tools, then References, what items are checked?

    Maybe you don't have the correct references for this control?
    Last edited by ottomatic; 08-31-04 at 18:34.

  3. #3
    Join Date
    Apr 2004
    Posts
    35
    I don't think the references are the problem since I have another form in the same db with two dt pickers that do the same things. I don't know what is wrong.

    Here are the references I have checked, I hope you can find something in here:

    - Visual Basic For Applications
    - Microsoft Access 10.0 Object Library
    - OLE Automation
    - Microsoft AcriveX Data Objects 2.1 Library
    - Microsoft Office XP Web Components
    - Microsoft DAO 3.6 Object Library
    - Microsoft Visual Basi for Applications Extensibility 5.3
    - Microsoft Windows Common Controls-26.0
    - Micorsoft Calendar Control 10.0
    - Microsoft DataGrid Control 6.0 (OLEDB)

    HELPPPPP
    MARGA

  4. #4
    Join Date
    Sep 2003
    Posts
    228
    do you have this file on your machine?

    mscomclt2.ocx

  5. #5
    Join Date
    Apr 2004
    Posts
    35
    No, I dont have it.

    Is that the problem???

    What do I have to do??
    MARGA

  6. #6
    Join Date
    Apr 2004
    Posts
    35
    Is mscomclt2.ocx or mscomct2.ocx ??

    I have mscomct2.ocx, I thought that one is for the dt picker. Am I wrong??
    MARGA

  7. #7
    Join Date
    Sep 2003
    Posts
    228
    I suggest you make a dummy database with this form and the code behind it and see if you have the same problem. As I said, it worked on my end. Sorry to be of no help.

  8. #8
    Join Date
    Apr 2004
    Posts
    35
    Thank you for your help


    Does somebody have any idea what is wrong????
    MARGA

  9. #9
    Join Date
    Aug 2004
    Posts
    7
    what does debug.print now() return ?
    try date()
    also
    in the default value for the form field you could type =now()

  10. #10
    Join Date
    Apr 2004
    Posts
    35
    debug.print now() returns today's day and time.

    Date() didn't work

    I dont know if what you mean with the default value for the form field, are the propeties for the dt picker in the form. If it is, the dtpicker doesn't have Default, it only have Value and I can't put a variable like Now or Date.




    HELPPPP
    MARGA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •