Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open one form twice

Status
Not open for further replies.

patfee

Programmer
Dec 14, 2004
78
NL
Hi,

I would like to open 1 for twice... is that possible without making a duplicate?

i.e. i have a form (Project_FRM) which is openen with a project_id as the primary key. Incase there are "clasing" intervention dates entered in the schedule (with an already existing project), a screen pop-ups (form) showing the clashing project. I have placed a button on this "clash form" which i intend to use to "open" the project.

When i do this with "DoCmd.OpenForm "Project_FRM", 0, , "ID = " & Me!Proj_ID, acFormEdit, acDialog" than the first "Project_frm" is used.

Any ideas on how i casn open this "Project_FRM" twice showing a different project??

Thanks
Patrick
 
Have a look at the New keyword in the VBA help file.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

I am researching doing something similar (or the same) could you elaborate about "New Keyword" - New in what/where?

Thanks
 
New in what/where?
As a keyword search for the VBA help engine.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You need to create a form object for each instance of a form you want to open. That's where the "New" keyword comes in.

Example:

Private Sub OpenFormTwice()

Dim Frm1 As frmYourFormName
Dim Frm2 As frmYourFormName

' Note: You could say "Dim Frm1 As Form"
' but the above is supposed to be better

Set Frm1 = New Form_frmYourFormName
Set Frm2 = New Form_frmYourFormName

' Note: "Form_" is required before your form's name

DoCmd.OpenForm Frm1, acNormal, , "your WHERE condition"
DoCmd.OpenForm Frm2, acNormal, , "your WHERE condition"

' Note: Any design changes you make to these form
' objects won't be saved in the original form.

' Note: Form objects created and instantiated in this way
' open with their Visible property set to False,
' so you have to explicitely make them visible:

Forms!Frm1.Visible = True
Forms!Frm1.Visible = True

End Sub

Good luck...
ReluctantDataGuy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top