Results 1 to 7 of 7
  1. #1
    e.badin is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2011
    Posts
    16

    Error 3464 Reserved Error

    As the title says, I'm running into this error while trying to open a report:

    Error 3464 Reserved Error

    here is the code (I trimmed it a little):

    Code:
    Private Sub LKA2_RUN_BTN_Click()
    
    DoCmd.Hourglass True
    DoCmd.SetWarnings False
    
    On Error GoTo Err_Handler
        'Purpose:  Open the report filtered to the items selected in the list box.
        
        Dim varItem As Variant      'Selected items
        Dim strWhere As String      'String to use as WhereCondition
        Dim strDescrip As String    'Description of WhereCondition
        Dim lngLen As Long          'Length of string
        Dim strDelim As String      'Delimiter for this field type.
        Dim strDoc As String        'Name of report to open.
        Dim strsql As String
        
        strDelim = """"
        strDoc = "TDL_REPORT_MWC"
        strWhere = ""
        strDescrip = ""
        DoCmd.OpenReport strDoc, acViewPreview, WhereCondition:=strWhere, OpenArgs:=strDescrip
        
    
    DoCmd.SetWarnings True
    DoCmd.Hourglass False
    
    Exit_Handler:
        Exit Sub
    
    Err_Handler:
        If Err.Number <> 2501 Then  'Ignore "Report cancelled" error.
            MsgBox "Error " & Err.Number & " - " & Err.Description, , "cmdPreview_Click"
        End If
        Resume Exit_Handler
    End Sub



    Edit: I noticed the same code works perfect in Access 2007...

  2. #2
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    Try changing...
    Code:
    DoCmd.OpenReport strDoc, acViewPreview, WhereCondition:=strWhere, OpenArgs:=strDescrip
    ...to this...
    Code:
     
    DoCmd.OpenReport strDoc, acViewPreview, ,WhereCondition:=strWhere, , OpenArgs:=strDescrip
    I believe you are missing a some commas. For further explanation see...
    http://www.blueclaw-db.com/docmd_openreport.htm

  3. #3
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by GinaWhipp View Post
    Try changing...
    Code:
    DoCmd.OpenReport strDoc, acViewPreview, WhereCondition:=strWhere, OpenArgs:=strDescrip
    ...to this...
    Code:
     
    DoCmd.OpenReport strDoc, acViewPreview, ,WhereCondition:=strWhere, , OpenArgs:=strDescrip
    I believe you are missing a some commas. For further explanation see...
    http://www.blueclaw-db.com/docmd_openreport.htm
    Gina:

    You don't need the commas when using the argument names. So if you DON'T use the argument names (i.e. WhereCondition or OpenArgs) then you need the commas. If you use argument names then you don't So their code is correct. But I am wondering why they are setting the strWhere to "" (an empty string) which is an invalid filter. strWhere should NOT be used if it is going to be simply an empty string.

    So e.badin - why are you doing that?

  4. #4
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    @Bob,

    I always thought that you needed the *space holders* if you are using only some of the arguments names but not all. Hope I explained that correctly... So if I were only going to use OpenArg or strWhere then I would still need the commas and the ywould just default to the Default.

  5. #5
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by GinaWhipp View Post
    @Bob,

    I always thought that you needed the *space holders* if you are using only some of the arguments names but not all. Hope I explained that correctly... So if I were only going to use OpenArg or strWhere then I would still need the commas and the ywould just default to the Default.
    Well, it is like this. If you are going to use any named arguments you need to provide anything else that follows with named arguments. You can use commas up to the point of a named argument but what's the point. The point to using named arguments is you can eliminate all of the , , , , , , type of stuff.

    So you can do:

    DoCmd.OpenForm "FormNameHere", OpenArgs:=strSomething

    DoCmd.OpenForm "FormNameHere', WindowMode:=acAdd, OpenArgs:=strSomething

    DoCmd.OpenForm "FormNameHere", OpenArgs:=strSomething, WindowMode:=acEdit, WhereCondition:=strWhere

    The benefits to named arguments is that you can tell exactly what you're dealing with, you can put them in any order you choose, and you can avoid long lines of commas.
    or

  6. #6
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    @Bob,

    Hmmm, I guess you can teach an old dog(ette) new tricks! Thanks!

  7. #7
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by GinaWhipp View Post
    @Bob,

    Hmmm, I guess you can teach an old dog(ette) new tricks! Thanks!
    No worries as I learn new stuff all of the time as well. There is so much to learn about Access, I don't know if anyone really knows it all. I know of a few people who I would think may be close or might know it all but it is rare.

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

Similar Threads

  1. Error 13 Type Mismatch error
    By GlennBurg in forum Programming
    Replies: 1
    Last Post: 06-21-2011, 03:05 AM
  2. Replies: 8
    Last Post: 05-16-2011, 06:01 PM
  3. Reserved error (-3703) help!
    By infinite26 in forum Access
    Replies: 3
    Last Post: 02-02-2011, 10:55 AM
  4. Reserved Error -1517
    By Rick West in forum Queries
    Replies: 5
    Last Post: 12-10-2009, 02:12 PM
  5. 3464 error received
    By TEN in forum Programming
    Replies: 10
    Last Post: 07-08-2009, 07:25 PM

Tags for this Thread

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