Open specific form in another database?

G

GD

I'm trying to use a command button (cmdOpenLabels) on a switchboard
(F01_Switchboard) in one DB (PAYBACKS_8.0.mdb) to open another form
(F02_CMLabelsDataEntry) in another DB (CM-DM_Downloads.mdb). Also, there is a
different form in CM-DM_Downloads.mdb that needs to stay as the StartUp form.

I created a macro (M01_OpenLabelForm) in CM-DM_Downloads.mdb using OpenForm
to open F02_CMLabelsDataEntry. Then I created a macro
(M07_OpenCMLabelsForm), triggered by cmdOpenLabels, using the following
RunApp:

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "S:\HQ Common\DC
Finance\DATA_ANALYSIS\PAYBACKS\CM-DM Downloads.mdb/x M01_OpenLabelsForm"

I get the following when I try to run it:

Microsoft Office Access can't find the database file 'S:\HQ Common\DC
Finance\DATA_ANALYSIS\PAYBACKS\CM-DM Downloads.mdb/x M01_OpenLabelsForm.mdb.'
(NOTE: I don't know why it is listing the .mdb at the end. That's not how it
is entered in the command line.)

Can somebody please help me out? If code is the best answer, can you
specify where I need to substitute my info in your example? My code
reading/writing skills are a work in progress. THANKS!!!!!!!!
 
D

Dirk Goldgar

GD said:
I'm trying to use a command button (cmdOpenLabels) on a switchboard
(F01_Switchboard) in one DB (PAYBACKS_8.0.mdb) to open another form
(F02_CMLabelsDataEntry) in another DB (CM-DM_Downloads.mdb). Also, there
is a
different form in CM-DM_Downloads.mdb that needs to stay as the StartUp
form.

I created a macro (M01_OpenLabelForm) in CM-DM_Downloads.mdb using
OpenForm
to open F02_CMLabelsDataEntry. Then I created a macro
(M07_OpenCMLabelsForm), triggered by cmdOpenLabels, using the following
RunApp:

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "S:\HQ Common\DC
Finance\DATA_ANALYSIS\PAYBACKS\CM-DM Downloads.mdb/x M01_OpenLabelsForm"

I get the following when I try to run it:

Microsoft Office Access can't find the database file 'S:\HQ Common\DC
Finance\DATA_ANALYSIS\PAYBACKS\CM-DM Downloads.mdb/x
M01_OpenLabelsForm.mdb.'
(NOTE: I don't know why it is listing the .mdb at the end. That's not how
it
is entered in the command line.)

Can somebody please help me out? If code is the best answer, can you
specify where I need to substitute my info in your example? My code
reading/writing skills are a work in progress. THANKS!!!!!!!!


You appear to have include the command-line argument in the quoted string
that represents the database name. Although I don't work with macros much,
try this for you argument to RunApp:

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "S:\HQ
Common\DC Finance\DATA_ANALYSIS\PAYBACKS\CM-DM Downloads.mdb" /x
M01_OpenLabelsForm

Please note: that will have been broken onto multiple lines by the
newsreader, but it should all be on one line.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top