multiple instances of form in Access 2007


E

Esther

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
 
Ad

Advertisements

Ad

Advertisements

E

Esther

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
 

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