
Compact lots & lots of databases!! .... hmm
Hello,
I have a plan ...... and MSAccess97 & WinNT4.0 .... I would like to do the
following:
- have a table called dbs with 3 fields (dbID dbfolder dbname)
- have a form called f_dbs bound to the table dbs with 2 text fields
(dbfolder dbname) bound to their respective fields in the underlying table
in the detail section of the form .... have a cmdbutton called cmd_compact
in the form header section with an event procedure which would loop through
all the values stored in the table dbs and compact the various databases
specified through those values.
I have the following procedure for the moment:
Function Macro1()
On Error GoTo Macro1_Err
Dim dbfolder As String
Dim dbname As String
DoCmd.RunCommand acCmdCompactDatabase
Macro1_Exit:
Exit Function
Macro1_Err:
MsgBox Error$
Resume Macro1_Exit
End Function
(as you may notice, I converted a macro to VBA :-) ...)
anyway, I would like to pass the values from the table dbs (well, actually
at first I wanted to do it from the values in the fields on an unbound form
... but then I thought about the table!) to the cmdCompactdatabase command
... how do I do that? it doesn't seem to accept the values and I can't
figure out a workaround ....
can anyone help me? ... it this possible in the first place?
Thanks in advance,
L