469,282 Members | 1,704 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Open multiple instances of a form in MS Access

Is there any way to open mulitple instances of a form in Access? I need my form to be active and open 3 or 4 times during the same session. The only thing I can think of is creating the form everytime. Is there an easier way?
Thanks,
Colin
Feb 26 '07 #1
8 13480
willakawill
1,646 1GB
Hi Colin. Can you describe your problem in terms that are not your solution? i.e. My problem is x, y, z. Not I need to have multiple instances open because that is the answer to my problem and I only need to find out how to implement this. The answer to your problem might be much simpler than you think
Feb 26 '07 #2
I am creating a database for security traders in a financial company. I have created a form that allows the trader to input the number of shares, price, etc... One of those basic no-brainer forms. What I am looking to do is allow the traders to start one trade, leave the form open and start a new trade using the same form but allow each form to operate independantly. Any ideas?
Feb 26 '07 #3
willakawill
1,646 1GB
What is this process 'start a trade'?
Feb 26 '07 #4
Starting a trade would involve pulling up the "Create a new Trade" form then punching in the relavant data ie. price, quantity, etc.
However the time between starting a trade and finishing a trade could be half an hour or so. I would like the traders to be able to leave their original "Create a new Trade" form open while calling up a second instance of the "Create a new Trade" form and start a new trade.
Feb 26 '07 #5
ADezii
8,800 Expert 8TB
Is there any way to open mulitple instances of a form in Access? I need my form to be active and open 3 or 4 times during the same session. The only thing I can think of is creating the form everytime. Is there an easier way?
Thanks,
Colin
An Access Form is nothing more than a Class, and as such new Instances of it can be created. The following code will create 4 New Instances of a Form named frmTest, place them in a Public Array declared as frmTest, Cascade the Form Windows, then make frmTest the Current Form. All this is accomplished via the Click() Event of a Command Button on frmTest. BTW, each Form Instance can de identified by its Caption. Good Luck.
Expand|Select|Wrap|Line Numbers
  1. 'Public Array to hold Form Instances
  2. Public MyFormCollection(1 To 4) As Form_frmTest
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command15_Click()
  2. Dim intCounter As Integer
  3.  
  4. For intCounter = 1 To 4
  5.    Set MyFormCollection(intCounter) = New Form_frmTest
  6.    MyFormCollection(intCounter).Visible = True
  7.  
  8.    MyFormCollection(intCounter).Caption = "Form #" & intCounter
  9.  
  10.    DoCmd.RunCommand acCmdWindowCascade
  11. Next intCounter
  12.  
  13. Forms!frmTest.SetFocus
  14. End Sub
Feb 26 '07 #6
willakawill
1,646 1GB
OK. This is why I wanted in on the 'problem' rather than the fix. Would life not be simpler if each new trade appeared in a listbox and could be clicked to close it?
Feb 26 '07 #7
NeoPa
32,173 Expert Mod 16PB
I think I see where you're going with this one Will, but unless the trades are very simple then I think the multiple instance solution may prove the most practical. I've never had to use it myself and it's a little complicated to set up certainly, but for the operator to select an open trade and update the details I think multiple forms would be required.
Feb 28 '07 #8
Rabbit
12,516 Expert Mod 8TB
I would also think you would want to set Data Entry to yes. I don't know how updates to the table would affect each other.
Feb 28 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Barry Edmund Wright | last post: by
14 posts views Thread by SimeonD | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.