MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 3rd, 2002, 06:36 PM   #1
dantb
Board Regular
 
Join Date: Mar 2002
Location: Arkansas
Posts: 358
Default

Hi all, what I am trying to do is open a dbase file. I have no problem opening a workbook, but how can I change my sub to open a Acces file (labor dbase.mbd)
I know the workbooks.open is wrong but dont know what to substitute, and can it also open one of the forms within the dbase file at the same time. Thx Dan

FrmLbedit.Hide
ChDir "C:Unit PriceDbase"
Workbooks.Open Filename:="C:Unit PriceDocumentsCharges.xls"
dantb is offline   Reply With Quote
Old Apr 3rd, 2002, 08:19 PM   #2
dantb
Board Regular
 
Join Date: Mar 2002
Location: Arkansas
Posts: 358
Default

Sorry not trying to open a xls,
FrmLbedit.Hide
ChDir "C:\Unit Price\Dbase\"
Workbooks.Open Filename:="C:\Unit Price\Dbase\Labor Dbase.mbd"
But The Workbooks.Open Is not correct. Anyont know what it should be ?
dantb is offline   Reply With Quote
Old Apr 3rd, 2002, 08:41 PM   #3
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

Hi dantb.
You might want to go into VBA and familiarize yourself with DAO or ADO.
DAO is probably good enough for what you are looking for. Is easy to use.
Look up DAO or Data Access Objects in help.
Too big a subject to go into here.
Either that and/or SQL.
I am weak when it comes to databases but have poked around alittle with DAO.
Good Luck!
Tom
Tom Schreiner is offline   Reply With Quote
Old Apr 3rd, 2002, 08:48 PM   #4
dantb
Board Regular
 
Join Date: Mar 2002
Location: Arkansas
Posts: 358
Default

Ok thx Tom, I didnt know that trying to open a dbase file from excel was that intence. I will go and try and learn , thx again for your help, and Have a good evening. Thx again Dan
dantb is offline   Reply With Quote
Old Apr 3rd, 2002, 08:50 PM   #5
dantb
Board Regular
 
Join Date: Mar 2002
Location: Arkansas
Posts: 358
Default

I can hyperlink to the dbase (np), but was just trying to put it into vb
dantb is offline   Reply With Quote
Old Apr 5th, 2002, 05:55 PM   #6
sutjh
New Member
 
Join Date: Mar 2002
Posts: 15
Default

Hi Dantb,

First, in XL VBE: Tools, References, and tick checkbox for whichever MS Access Library you need eg "Micosoft Access 9.0 Object Library" if you have Access 2000, then try this..

Sub OpenAccessDB()

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

strDB ="C:\UnitPrice\Dbase\LaborDbase.mbd"
'I think that was your path, but check !
stFormName = "**Form Name you want in here**"


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

End Sub

(Not really sure if that is what you are after but hope it helps a bit !)

sutjh is offline   Reply With Quote
Old Apr 5th, 2002, 06:15 PM   #7
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

Hey Dan.
Don't be discouraged with DAO.
Very easy to use. If all you are needing are values from a database, you will have it doing exactly what you want with a minimum amount of code.
Tom
Tom Schreiner is offline   Reply With Quote
Old Apr 5th, 2002, 07:31 PM   #8
sutjh
New Member
 
Join Date: Mar 2002
Posts: 15
Default

Hi Dan/Tom,

Oops ! I really didn't want to discourage the use of DAO.It is extremely useful and has methods which ADO doesn't have (yet). It can't open a database or display a form, however, it isn't really meant for that !

Tom is quite correct in that you could very easily use it to replace the code behind the controls on the form that you want to show, depending on what the form does.

Sorry, I thought (probably quite wrongly) that you just wanted a shortcut to a data entry form !

sutjh is offline   Reply With Quote
Old Apr 5th, 2002, 07:52 PM   #9
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

No Problem sutjh.
I'm not too sure what Dan is after myself?
Maybe Dan isn't either?
Joking Dan!
Tom
Tom Schreiner is offline   Reply With Quote
Old Apr 5th, 2002, 09:52 PM   #10
dantb
Board Regular
 
Join Date: Mar 2002
Location: Arkansas
Posts: 358
Default

I think Tom Hit it on the head, just trying to get the dern dbase to open, then I can add the code to access the form. Thx Tom
dantb is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 02:18 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes