Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322

    Unanswered: ADP Error Opening a Form

    There was a problem accessing a property or method of the OLE Object

    Just started playing with ADP. Normally I'd build a From that has a selection criteria and shows some specifics about a set of rows, the user then selects the row and clicks a button to see the details. I get the error mentioned above though.

    The code is listed below. Any ideas? Is this An Access thing or a sql server thing?


    Code:
    Private Sub Command22_Click()
    On Error GoTo Err_Command22_Click
    
        Dim stDocName As String
        Dim stLinkCriteria As String
    
        stDocName = "Case"
        
        stLinkCriteria = "[CaseId]=" & Me![CaseId]
    
        DoCmd.OpenForm stDocName, , , stLinkCriteria
    
    Exit_Command22_Click:
        Exit Sub
    
    Err_Command22_Click:
        MsgBox Err.Description
        Resume Exit_Command22_Click
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Hi Brett what is your CaseID Field is it linked to something on your form

    i think the problem lies with your me![caseID] statement
    Try changing this to the name of your control

    Something like me!Text0.Value

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Found it....I guess SQL Server and ADP don't communicate too well together.

    It was probably a datatype conversion error in sql server...BECAUSE ADP didn't wrap quotes around the value. SO the "text" value was treated like a number

    Go figure

    I guess Access has always done it that way...and is not nearly as picky as a real database

    Code:
    stLinkCriteria = "[CaseId]='" & Me![CaseId] & "'"
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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