Open a Access Dbase File - Page 2
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Open a Access Dbase File

  1. #11
    New Member
    Join Date
    Mar 2002
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    What !!?

    My code opens an mdb AND the form..

    ..plus DAO is completely irrelevant for your request !

    Still, I guess Tom knows you better...


  2. #12
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Well not really, Still working on the problem,Tstom &Sutjh. But maby getting closer!. I have made sure that this option was checked. (Micosoft Access 9.0 Object Library), Still getting erors,I might just have something in the wrong place, But trying. This is what I have so far.

    Private Sub CmdMtr_Click()
    Dim oApp As New Access.Application
    Dim strDB As String
    Dim stFormName As String
    Sub OpenAccessDB()
    strDB = "C:UnitPriceDbaseUnit Price.mbd"
    stFormName = "CS Material"

    With oApp
    .OpenCurrentDatabase strDB
    .DoCmd.OpenForm stFormName
    .Visible = True
    .UserControl = True
    End With
    End Sub

  3. #13
    New Member
    Join Date
    Mar 2002
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    hey,dan..
    just in case, can you check that in your code your path ends in .mdb and not .mbd ? Also that you don't have "Sub OpenAccessDB()" stuck in there.

    If that's not it, try this and let me know what error you get...

    '*****************************
    Private Sub CmdMtr_Click()
    On Error GoTo Err_CmdMtr_Click

    Dim oApp As New Access.Application
    Dim strDB As String
    Dim stFormName As String

    strDB = "C:UnitPriceDbaseUnitPrice.mdb"
    stFormName = "CS Material"

    With oApp
    .OpenCurrentDatabase strDB
    .DoCmd.OpenForm stFormName
    .Visible = True
    .UserControl = True
    End With


    Exit_CmdMtr_Click
    Set oApp = Nothing
    Exit Sub

    Err_CmdMtr_Click:
    MsgBox "Error " & Err & ": " & Error(Err)
    Resume Exit_CmdMtr_Click

    End Sub
    '*****************************

    It's probably bet to set oApp to nothing if you are gettihg errors, otherwise you might have some invisible Access applications hanging around !


  4. #14
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi sutjh, tryed it both ways after fixing error. This is what I have and error recieved.
    Private Sub CmdMtr_Click()
    Dim oApp As New Access.Application
    Dim strDB As String
    Dim stFormName As String
    strDB = "C:UnitPriceDbaseUnitPrice.mdb"
    stFormName = "CS Material"

    With oApp
    .OpenCurrentDatabase strDB
    .DoCmd.OpenForm stFormName
    .Visible = True
    .UserControl = True
    End With
    End Sub

    The Private Sub line has a Yellow arrow by it, and(oApp As New Access.Application)is highlighted.
    Error Mesage - compile error : User-defined type not defined.

  5. #15
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    IT WORKS WEEEEEE>>>> Thank you so much Sutjh, The code wasnt the problem, I had Microsoft Office 9.0 Library checked in References , Neaded Microsoft Access Objects Library Checked. Thanks again for your Help, only been working with vba 3 months, Lots to learn, have a good one Dan

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com