Results 1 to 9 of 9

Thread: [RESOLVED] Error in Access Form

  1. #1

    Thread Starter
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    836

    Resolved [RESOLVED] Error in Access Form

    I have a tiny little Access form with the following code

    VB Code:
    1. Private Sub Form_Load()
    2.     Label41.Visible = False
    3.     ctlDate.Value = Date - 1
    4.     strDateName = "AdmitDate"
    5.     strDownloadType = "All"
    6. End Sub

    When opening this form I get the following error message:

    There is no object in this control

    It then highlights the "ctlDate.Value = Date -1" line.
    What...the...hell?

    I do have a control on the form named ctlDate so I am lost here.

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Error in Access Form

    What type of control is cltDate? I ask because your code looks fine.
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3

    Thread Starter
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    836

    Re: Error in Access Form

    I've programmed in VB forever but this Access thing (forms, controls) is kinda foreign to me. How can I tell because it's not my code.

    It looks exactly like a textbox but I think it's a DTPicker. Here's some info from Access.

    Name .....ctlDate
    OLE Class.....DTPicker
    Class.....MSComCtl2.DTPicker.2
    Last edited by The_Grudge; Feb 8th, 2006 at 09:47 AM.

  4. #4
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Error in Access Form

    OK so it is a DTPicker.

    Can yuo check in your VBA Tools-->References to see if you have a reference to "Microsoft Windows Common Controls-x.x"?

    Also, what version of Access are you using? (I'm hoping its not 97....)
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  5. #5

    Thread Starter
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    836

    Re: Error in Access Form

    I'm using Access 2000.

    Microsoft Windows Common Controls - 2 6.0 (SP6)
    Microsoft Windows Common Controls - 6.0 (SP6)

    I think I may know the issue. The database/VBA code was developed on a PC that I know for a fact does not have SP6. They are still running VB sans any service packs.

    Also, if I go into Access and click on the "more controls" icon in the toolbox and select "Microsoft Date & Time Picker Control SP6" I get the following error when I try to add a new DTPicker to the form:

    The OLE server isn't registered. To register the OLE server, reinstall it.

  6. #6
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Error in Access Form

    Yea, that a problem. You are going to have to do an OLE server register reinstall.
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  7. #7

    Thread Starter
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    836

    Re: Error in Access Form

    Pardon my french but how the hell do I do that?

    Oh, and what else is sweet.....in all of the MDAC updates/installs in the last few days to get this Database working my VB app that worked perfectly last week is all dicked up now.

    This will be a fun day.

  8. #8
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Error in Access Form

    Have a look at the following KB artice on using Regsvr32 to register OLE controls.

    http://support.microsoft.com/kb/q249873/
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  9. #9

    Thread Starter
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    836

    Re: Error in Access Form

    Go figure, but when I fixed the broken references/components in my VB program it fixed this issue too.

    Who the hell knows why....dah well, it's working I guess.

Posting Permissions

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



Click Here to Expand Forum to Full Width