open multiple instances of a form

  • Thread starter Thread starter Miranda
  • Start date Start date
M

Miranda

hi, i've got a drop down box where a user selects a project - the project
details are then opened in another form and the first form is closed. is it
possible to select multiple projects from the drop down box and therefore
open multiple instances of the project form ?
 
thanks for that - i've read the info there. now i'm wondering how to go
about this. this is the way my db works: on the first form you select the
project you want to work on...the 2nd form then gives you list of
things/actions you can do...one of the next forms that can be opened is to
input data. so if i use the new function to open multiple instances of the
2nd form can i then just go on as normal i.e. once the 2nd form is open i
can just click on the button/action i want to perform on that project (say,
input data) and then another form is loaded and i should be able to input
data for multiple projects (assuming i opened multiple instances of the
second form)....i hope that is clear enough..

thanks,
miranda
 
ok, so it seems i'll need to open multiple instances of the 2nd form and
also of the 3rd form.

now i have another question - when i open the 2nd form the projects name is
supposed to be displayed in a text box at the top of the form - this is no
longer working since i added the code to open multiple instances. in the
openAClient function i;ve tried adding something like
Form_projects.jobdesc = Forms!firstform!JobSelected but this doesn't seem to
work - where jobselected is the drop down box on the first form.

any ideas?

thanks!
miranda
 
Yes, this is part of the fun. The Forms collection has multiple entries now
with the same name, so they must be distinguished by index number. But of
course the index numbers keep changing as forms are opened and closed, so
you can only identify which index at the precise moment you need to run the
code.

The example code uses the hWnd of the instance to identify the window.
Programmatically, you can distinguish which member of the Forms collection
you wish to refer to by looping through the Forms collection, and examining
the hWnd of each:
For lng = 0 To Forms.Count - 1
If Forms(lng).hWnd = 9999 Then
MsgBox "The instance is Forms(" & lng & ")"
End If
Exit For
Next
 
Back
Top