|
-
Jun 7th, 2005, 08:03 AM
#1
Saving a database
I am using MS Access 2002.
What I need to do, is when the user clicks save, it brings up a dialog box asking them what they would like to call it, and where to save it.
I tried looking for a savefile dialogbox in VBA...but I cant seem to find it, and I am not sure I would know how to use it anyways
-
Jun 7th, 2005, 08:57 AM
#2
Re: Saving a database
okay, I found the commondialog option...I have it opening the save menu, and only showing .mdb file extensions...but when I click save, it doesnt save anything :/
-
Jun 7th, 2005, 09:08 AM
#3
Re: Saving a database
you have to tell it what to save and where to save it, using the values returned by the commondialog.
fo save in access it should have its own save method to save the database, similar to excel or word, that will display the built in save as dialog, which works a bit different to the commondialog.
pete
-
Jun 7th, 2005, 09:24 AM
#4
Re: Saving a database
thanks for your help..buit that still kinda leaves me at square 1
I tried findind the save method, but it tells me how to save with an html file....and I cant seem to find the right command to save an access file.
I found a few keywords, but when i tried to use them, it wouldnt give me any parameters or anything.
-
Jun 7th, 2005, 10:27 AM
#5
Re: Saving a database
anyone? I also need to be able to load them..
-
Jun 7th, 2005, 12:59 PM
#6
Re: Saving a database
*bump*
Really need this one solved too :/
-
Jun 7th, 2005, 01:48 PM
#7
Re: Saving a database
I need a bit more details.
Typically you write code to save data to a table in a database, not the whole database itself.
So, my first question is, why do want to save the entire database? Is this for backup purposes?
Second, if you have the database open, then I'm guessing you aren't going to be able to do anything with it, until it is closed. So, if you do want to backup up, you probably want to write a little app that will do that for you.
-
Jun 7th, 2005, 01:50 PM
#8
Re: Saving a database
hrm..i guess thats a good point
But yes, I want it as backup purposes.
Once a year I want to be able to click "Backup Database" and then that database will hold all the information for the previous year..so I can open it up at another date if needed.
-
Jun 7th, 2005, 02:07 PM
#9
Re: Saving a database
 Originally Posted by kfcSmitty
hrm..i guess thats a good point
But yes, I want it as backup purposes.
Once a year I want to be able to click "Backup Database" and then that database will hold all the information for the previous year..so I can open it up at another date if needed.
Ok. I have done this on a number of applications, but not using VBA. If this is a once a year utility program, then I would write a one screen VB program that:
1. Closes the database
2. Copies the database to whereever you need it to go
3. Logs the date and time of the backup for future reference
-
Jun 7th, 2005, 06:22 PM
#10
Re: Saving a database
VB Code:
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Text Files (*.txt), *.txt")
If fileSaveName <> False Then
MsgBox "Save as " & fileSaveName
End If
i don't use access, so this is posted straight from the vba helpfile, and not tried
then usew the returned filesavename with the saveas method
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|