KeithWilliams
Registered User.
- Local time
- Today, 20:20
- Joined
- Feb 9, 2004
- Messages
- 137
Hi,
I would like to open multiple instances of a form simultaneously, independent of each other.
I checked out the information on this thread: http://www.access-programmers.co.uk/forums/showthread.php?t=49847
The KB article referenced seems to depend on recursive references from one form to the next in a "chain", so the user breaking the chain by closing one of the forms would cause all instances below it in the chain to be closed.
I want to create instances that are independent of each other, and this is what I tried:
(In a module)
Global gf_form(100) As Form
Global gint_formCount As Integer
(In the script where I create the instances)
<loop condition>
Set gf_form(gint_formCount) = New Form_F_Debrief
DoCmd.OpenForm gf_form(gint_formCount).Name, , , "[IncidentNo]=" & intIncident & " AND [IncidentYear] = " & intYear
gint_formCount = gint_formCount + 1
<end of loop>
However, the OpenForm command appears to just apply the latest criteria to the existing form, rather than creating another instance, so I always end up with just one instance of Form_F_Debrief open.
I know this approach works in other programming languages, so I'm puzzled what Access has against it!
Is there a way of opening multiple instances without employing the recursion trick and suffering its limitations?
Many thanks,
Keith.
I would like to open multiple instances of a form simultaneously, independent of each other.
I checked out the information on this thread: http://www.access-programmers.co.uk/forums/showthread.php?t=49847
The KB article referenced seems to depend on recursive references from one form to the next in a "chain", so the user breaking the chain by closing one of the forms would cause all instances below it in the chain to be closed.
I want to create instances that are independent of each other, and this is what I tried:
(In a module)
Global gf_form(100) As Form
Global gint_formCount As Integer
(In the script where I create the instances)
<loop condition>
Set gf_form(gint_formCount) = New Form_F_Debrief
DoCmd.OpenForm gf_form(gint_formCount).Name, , , "[IncidentNo]=" & intIncident & " AND [IncidentYear] = " & intYear
gint_formCount = gint_formCount + 1
<end of loop>
However, the OpenForm command appears to just apply the latest criteria to the existing form, rather than creating another instance, so I always end up with just one instance of Form_F_Debrief open.
I know this approach works in other programming languages, so I'm puzzled what Access has against it!
Is there a way of opening multiple instances without employing the recursion trick and suffering its limitations?
Many thanks,
Keith.