Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Dbase

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

    Default

    Hi all, Still trying to connect to a access dbase,I might be getting closer, If possable let me know if I am even doing this right and why it is hanging on.((.OpenCurrentDatabase strDB))

    (I put the below under General)

    Sub OpenAccessDB()
    Dim oApp As New Access.Application
    Dim strDB As String
    Dim stFormName As String

    (And this on my Cmd button)

    Private Sub CommandButton1_Click()
    strDB = "C:UnitPriceDbaseLaborDbase.mbd"
    stFormName = "Cs Material"
    With oApp
    .OpenCurrentDatabase strDB
    .DoCmd.OpenForm stFormName
    .Visible = True
    .UserControl = True
    End With
    End Sub

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,940
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    Dan,

    I just tried your code. It works on my machine if you change

    strDB = "C:UnitPriceDbaseLaborDbase.mbd"

    to

    strDB = "C:UnitPriceDbaseLaborDbase.mdb"

    i.e. use the extenstion MDB not MBD.

    HTH,
    Dan

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

    Default

    Thanks DK, typo there. I changed to .mdb, but still hanging on that one line
    .OpenCurrentDatabase strDB . Since the code works on yours, I must nead something else checked in my vba to run it. Thanks again Dan

Some videos you may like

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
  •