Dbase

dantb

Active Member
Joined
Mar 20, 2002
Messages
358
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
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,915
Members
448,532
Latest member
9Kimo3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top