![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 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 |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
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 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
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 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|