Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

multiple instances of form in Access 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Esther - 10 May 2008 17:17 GMT
I want to open multiple instances of the same form and name the tabs in
Access 2007 and I'm having trouble.  I have a continuous form (form1) that
lists the employees in a table.  The command button beside each employee
takes their id number and opens form2 with their employee data.  The users
want to go back to form1 and select another employee, leaving form2 open for
employee1 and showing their last name on the tab and open form2 for employee2
with their last name on the tab so they can work between the two employees.

I have written a procedure that accomplishes the goal of a named tab for one
employee.

There are two questions:

1.  When I exit the database and pull up the form (just by itself, not using
the form), it continues to hold the employee name from the last time the form
was opened.

2.  How to I open multiple instances of the form?  I've tried the New
keyword in both the "Set" and "Dim" and neither have worked.

Here is my on-load procedure when form2 opens:

Private Sub Form_Load()
Dim frm As Form
DoCmd.OpenForm "Employee"

Set frm = Forms!Employee
Form_Employee.Visible = True

Form_Employee.Caption = Me.EMP_LastName
End Sub

Thanks in advance!

Esther
Douglas J. Steele - 10 May 2008 18:17 GMT
Try:

Dim frm As Form

Private Sub Form_Load()

 Set frm = New Forms!Employee
 frm.Visible = True
 frm.Caption = Me.EMP_LastName

End Sub

For more information, see what Allen Browne has at
http://www.allenbrowne.com/ser-35.html

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

>I want to open multiple instances of the same form and name the tabs in
> Access 2007 and I'm having trouble.  I have a continuous form (form1) that
[quoted text clipped - 37 lines]
>
> Esther
Esther - 12 May 2008 00:01 GMT
Thanks for the URL for Allen Browne's tips.  His argument for not using the
"new" in the procedure is convincing.  I tried to replicate his collection
method.  I understand what it's trying to do - but it seems that the very
first button (Open an instance) doesn't allow the user to select a particular
record.  It seems like you get what you get when you click on it.  After
that, you can choose a particular record.  

I don't know VB well enough to figure out how I can get the record selector
on the first screen, given that there is no record source for the opening
screen.

Also, what happens to the clnClient collection if the user closes the window
instead of using the "Close all instances" command button.  Does it matter
(assuming that the user did not open the form from the nav window)?

Can you help?

Thanks
Esther
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.