Form is link with another form

  • Thread starter Thread starter Anna
  • Start date Start date
A

Anna

Macro and button all works fine. It goes to other database and open the
form from their. Now only problem is that there are two forms link to
each other. When i click on the button it works fine and open that form
which i need but there is also a link on that form which open another
form. Is it possible that i open the 2nd form which is linked with the
first form or any other way

Private Sub Command233_Click()
On Error GoTo Err_Command233_Click
Call Shell("""C:\Program Files\Microsoft Office\Office\MSACCESS.EXE""
""C:\RDLog.mdb""/XTransOpenForm", 1)

Exit_Command233_Click:
Exit Sub

Err_Command233_Click:
MsgBox Err.Description
Resume Exit_Command233_Click

End Sub


* Click Macro (on the left of the screen)
* Click New (at the top of the screen)
* In the "Action" column scroll down to "OpenForm"
* In the options box (lower section of the macro screen) scroll down to
the
form you want to open.
* Just to start with (you can change it later) I would leave the View
at
"Form" and leave "Fitler" Data" and "Where" all blank.
* For the Mode try "Normal" for now.
* Save the macro as TransOpenForm

Thank You.
 
If you don't mind me asking, why on God's GREEN EARTH are you opening a
form in another database? Why not open a form in the first database
and link to tables in the other database? What you're doing is so
inefficient I'll personally hand-deliver a slap to anyone who answers
this.

And while I'm on my soapbox, what happens when "Command233" goes
haywire and you're out sick that day? Will anyone know where to find
"Command233"?
 
Macro and button all works fine. It goes to other database and open the
form from their. Now only problem is that there are two forms link to
each other. When i click on the button it works fine and open that form
which i need but there is also a link on that form which open another
form. Is it possible that i open the 2nd form which is linked with the
first form or any other way

I have to agree with ManningFan that you're going ALL the way around
the barn with this code. Perhaps you're making the very common error
of assuming that Forms contain data; they don't, they're just
*windows* on the data.

Do you need to link to the Form? Or don't you instead want to link *to
the data* which (in this other database) is displayed on the form?

John W. Vinson[MVP]
 
I copy both forms in database 1 and want to link *to the data* which
(in this other database 2) is displayed on the form

Thank You.
 
Link to the table (or query, or whatever is feeding the form) in the
other database. In a properly designed environment there should be no
reason to have 2 databases open at the same time.
 
I copy both forms in database 1 and want to link *to the data* which
(in this other database 2) is displayed on the form

THen use File... Get External Data... Link to link to the tables, and
base your Form on those linked tables.

John W. Vinson[MVP]
 
Back
Top