Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 8th, 2005, 06:21 AM
Registered User
 
Join Date: May 2005
Location: glasgow, , United Kingdom.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using common dialog with access

I am linking a address book database to a vb form using common dialog but have got stuck. Please could you take a look and see if you can help.

How do I open a specific access file using the common dialog function? I presume it needs to be automatically displayed in the file name of the open file box.

Also I want to be able to either open it at the beginning of the file or create new record by opening at the end of the file. I have created a menu with new and open for this purpose but can't find the code I need.

Thanks for looking

A very grateful Scot.
 
Old May 9th, 2005, 03:08 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Be glad to look; could you post something to look at?

Are you trying to open a database (*.mdb)?
Is so, are there more than 1 database that might be what the user is looking for? (Seems more than 1 table within 1 database would be less messy, but even that seems unnecessary...)
 
Old May 14th, 2005, 06:01 AM
Registered User
 
Join Date: May 2005
Location: glasgow, , United Kingdom.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks. I specifically need to open a db file called address. On Private Sub mnuNew_Click()I need to open it to eof and on Private Sub mnuOpen_Click()I need to open to bof.

I have so far

f = FreeFile
CMDialog1.Filter = "all files|*.*|text|*.txt"
CMDialog1.FilterIndex = 0
CMDialog1.FileName = "C:\Address"
CMDialog1.ShowOpen
MsgBox "You selected: " + CMDialog1.FileName
TextFileNum = FreeFile
OpenFileName = CMDialog1.FileName
Open OpenFileName For Output As #f

Also are there any good tutorial sites on common dialog and linking db's to access via code (not data control).

Thanks for your help



A very grateful Scot.




Similar Threads
Thread Thread Starter Forum Replies Last Post
coding problem in common dialog box cancertropica Visual Basic 2005 Basics 0 July 30th, 2008 09:38 AM
Getting common dialog to work (re-install) Ragtime Access VBA 0 November 2nd, 2007 10:59 PM
How to use the flags int common dialog box diegoblin Beginning VB 6 2 November 8th, 2006 03:41 PM
Access db/ Common Dialog/ errors in code azkabancells VB Databases Basics 1 May 25th, 2005 10:34 AM
Instantiating Common Dialog Box Dhodie Pro VB 6 2 July 19th, 2004 04:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.