Results 1 to 6 of 6
  1. #1
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156

    run time error 94

    Hello everyone. I found a appointment calendar I am trying to get working. When I open the appointment form I get an :Invalid use of null" error but the form opens anyway after I close the error window. When I click new appointment I get the error again and it high lights the line

    vDateTime = CDate(OpenArgs)


    I do not understand this error. I have included the code.



    Code:
    Public Sub EnableFields()
    'Reset input fields to default values and disable'
    Dim vDateTime As Date
        Me.cboStartTime.Enabled = True
        Me.cboEndTime.Enabled = True
        Me.txtStartDate.Enabled = True
        Me.txtEndDate.Enabled = True
        Me.txtSubject.Enabled = True
        Me.txtLocation.Enabled = True
        Me.txtNotes.Enabled = True
        Me.cmdStartDate.Enabled = True
        Me.cmdEndDate.Enabled = True
        
        vDateTime = CDate(OpenArgs)                                         'fetch appointment date from OpenArgs
        Me.txtStartDate = DateValue(vDateTime)                              'show default appt start date
        Me.txtEndDate = DateValue(vDateTime)                                'show default appt end date
        Me.cboStartTime = TimeValue(vDateTime)                              'and default Start Time
        Me.cboEndTime = DateAdd("n", conPeriod, Me.cboStartTime)            'and default End Time
        Me.txtSubject = ""
        Me.txtLocation = ""
        Me.txtNotes = ""
        Me.chkExported = False
    End Sub
    Thank-you

    Cheeco

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,426
    openargs is a variable that is passed as a parameter in the openform command - sounds like you are not providing a value - so your problem is in the code which opens the form or you are trying to open the form directly from the navigation window.

  3. #3
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,426
    modify your code to

    vDateTime = CDate(nz(OpenArgs,Date())

    and it will probably open on todays date

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Where is your code to open the form?
    Can you show the link to the code you "found"?

  5. #5
    CHEECO is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    156
    Thank-you Ajax. I changed the code and it now works. I have another issue that has popped up. I don't think it has anything to do with the change though. I have a google map search in the data base and for some strange reason I am getting a "To Help Protect Your Security, Internet Explorer has blocked this website from displaying content with security certificate errors. Click here for options..." text box thatI have to close each time. I have not used the search is a while so I don't know when it started popping up.

  6. #6
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,426
    suggest start a new thread - this is a completely different issue

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 01-04-2016, 09:40 AM
  2. Replies: 11
    Last Post: 05-01-2014, 11:56 AM
  3. Replies: 3
    Last Post: 01-23-2014, 07:49 AM
  4. Replies: 0
    Last Post: 07-16-2012, 05:42 AM
  5. Replies: 6
    Last Post: 05-30-2012, 12:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums