C
CWH via AccessMonster.com
Hello;
Wondering if someone could help me stop pulling my hair out…. I am trying to
programmatically create a new database. When a user clicks on a command
button I would like the user to select a folder where to place the new
database. VB would then name the new database RMS – “The Users Name†(the
contents of a drop down comboBox “Team Nameâ€), then the current date.
Secondly I would like to then import tables into the new database – Although
I haven’t gotten past start yet….
Example: RMS – John Doe, 02112007
This is what I have so far. It opens a browse folder and allows me to select
a folder and create a new data file. Its not creating a .mdb file, or
grabbing the field contents of the combobox: Team Name.
Sub CreateNewMDBFile_Click()
Dim ws As Workspace
Dim db As Database
Dim dbBackup As DAO.Database
Dim strFile As String
Dim strFolderName As String
Set ws = DBEngine.Workspaces(0)
strFolderName = BrowseFolder("Where would you like to save your records?")
Set dbBackup = ws.CreateDatabase("RMS- (ComboBox:Team Name],(" & Format
(Date, "mmddyyyy") & ").mdb", dbLangGeneral)
Any help would be appreciated.
Thanks
Wondering if someone could help me stop pulling my hair out…. I am trying to
programmatically create a new database. When a user clicks on a command
button I would like the user to select a folder where to place the new
database. VB would then name the new database RMS – “The Users Name†(the
contents of a drop down comboBox “Team Nameâ€), then the current date.
Secondly I would like to then import tables into the new database – Although
I haven’t gotten past start yet….
Example: RMS – John Doe, 02112007
This is what I have so far. It opens a browse folder and allows me to select
a folder and create a new data file. Its not creating a .mdb file, or
grabbing the field contents of the combobox: Team Name.
Sub CreateNewMDBFile_Click()
Dim ws As Workspace
Dim db As Database
Dim dbBackup As DAO.Database
Dim strFile As String
Dim strFolderName As String
Set ws = DBEngine.Workspaces(0)
strFolderName = BrowseFolder("Where would you like to save your records?")
Set dbBackup = ws.CreateDatabase("RMS- (ComboBox:Team Name],(" & Format
(Date, "mmddyyyy") & ").mdb", dbLangGeneral)
Any help would be appreciated.
Thanks