A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Multiple Form Instances - Add new record



 
 
Thread Tools Display Modes
  #1  
Old November 26th, 2008, 01:52 PM posted to microsoft.public.access.tablesdbdesign
Matthew Pfluger[_2_]
external usenet poster
 
Posts: 36
Default Multiple Form Instances - Add new record

Can I open a new instance of a form and move it to a new record? If so,
could any problems arise if a user opens two instances in this way (set to
new records)?

Thanks,
Matthew Pfluger
  #2  
Old November 26th, 2008, 05:21 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Multiple Form Instances - Add new record

Matthew

Perhaps you work with a better-trained, more intelligent group of users.
The folks I build applications for can't be troubled with figuring out or
remembering which instance of a form they are working in, so I typically
build their applications so they can focus on one thing at a time.

What business need will you be able to address/answer by having multiple
instances of the same form...?

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Matthew Pfluger" wrote in
message ...
Can I open a new instance of a form and move it to a new record? If so,
could any problems arise if a user opens two instances in this way (set to
new records)?

Thanks,
Matthew Pfluger



  #3  
Old November 26th, 2008, 06:10 PM posted to microsoft.public.access.tablesdbdesign
Matthew Pfluger[_2_]
external usenet poster
 
Posts: 36
Default Multiple Form Instances - Add new record

I am a Mechanical Engineer building a Quotes Database for a group of more
Mechanical Engineers, and my coworkers like to look at details for more than
one part/quote/vendor at a time. Also, they don't need to know what instance
they are in; they just like the flexibility of having multiple "Details"
forms open at once.

I did end up figuring out a way to do this. Once the new instance of the
form is open and active, I just call the following command:
Docmd.GoToRecord ,,adNewRecord

Since I don't have to refer to the form by name, the code works with
multiple instances. Granted, there should not often be a case where someone
is entering more than one NEW quote at a time, but I like the flexibility of
multiple forms.

Thanks,
Matthew Pfluger


"Jeff Boyce" wrote:

Matthew

Perhaps you work with a better-trained, more intelligent group of users.
The folks I build applications for can't be troubled with figuring out or
remembering which instance of a form they are working in, so I typically
build their applications so they can focus on one thing at a time.

What business need will you be able to address/answer by having multiple
instances of the same form...?

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Matthew Pfluger" wrote in
message ...
Can I open a new instance of a form and move it to a new record? If so,
could any problems arise if a user opens two instances in this way (set to
new records)?

Thanks,
Matthew Pfluger




  #4  
Old November 27th, 2008, 08:05 PM posted to microsoft.public.access.tablesdbdesign
Graham Mandeno
external usenet poster
 
Posts: 593
Default Multiple Form Instances - Add new record

Hi Matthew

You can create multiple instances of a form by creating Form class variables
and using the New keyword:

Dim f1 as Form, f2 as Form
Set f1 = New Form_Employees
f1.Filter = "EmployeeID=4"
f1.FilterOn = True
f1.Visible = True
Set f2 = New Form_Employees
f2.DataEntry = True
f2.Visible = True
....

The form will only exist for as long as the class variable is in scope, so
normally you would declare these at module level.

You don't have the luxury of passing arguments to the OpenForm method, but
you could declare an array of forms and write your own function to which you
can pass arguments in the same way you do for OpenForm. Of the top of my
head, the only features you couldn't implement would be WindowMode:=acDialog
and OpenArgs. Other properties such as Filter,
AllowAdditions/Edits/Deletions, DataEntry, Visible, Caption, etc could
easily be passed as arguments.
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

"Matthew Pfluger" wrote in
message ...
Can I open a new instance of a form and move it to a new record? If so,
could any problems arise if a user opens two instances in this way (set to
new records)?

Thanks,
Matthew Pfluger



  #5  
Old November 28th, 2008, 05:18 AM posted to microsoft.public.access.tablesdbdesign
Matthew Pfluger[_2_]
external usenet poster
 
Posts: 36
Default Multiple Form Instances - Add new record

Yeah, multiple instances are great! I am a huge fan now. I'm using about 4
forms in this way with public forms collections. My "customers" (co-workers)
really like the feature, too.

The only strange behavior I've notice is that the Form_Close event doesn't
seem to run all the time. When an instance is open and I strike CTRL+W or
click the CLOSE (X) button, the Close event doesn't fire. This means that
the form doesn't run code to remove itself from the public collection, so it
remains in memory. I don't know how to get around this, but I'll keep trying.

I also discovered that a combo box that used another control in its
RowSource data query no longer functioned correctly. After a lot of work, I
ended up using a procedure that created a RecordSet, opened the RecordSet
based on another control in the instance, set the RecordSet results as the
ComboBox's Value List, and ended the procedure without closing the RecordSet.
Since this procedure can be called from the form's controls' events, I could
pass it variables within instances. Turned out pretty slick!

Thanks for all the ideas, MVPs. On this Thanksgiving, I'm thankful for your
help! :-)

Matthew Pfluger


"Graham Mandeno" wrote:

Hi Matthew

You can create multiple instances of a form by creating Form class variables
and using the New keyword:

Dim f1 as Form, f2 as Form
Set f1 = New Form_Employees
f1.Filter = "EmployeeID=4"
f1.FilterOn = True
f1.Visible = True
Set f2 = New Form_Employees
f2.DataEntry = True
f2.Visible = True
....

The form will only exist for as long as the class variable is in scope, so
normally you would declare these at module level.

You don't have the luxury of passing arguments to the OpenForm method, but
you could declare an array of forms and write your own function to which you
can pass arguments in the same way you do for OpenForm. Of the top of my
head, the only features you couldn't implement would be WindowMode:=acDialog
and OpenArgs. Other properties such as Filter,
AllowAdditions/Edits/Deletions, DataEntry, Visible, Caption, etc could
easily be passed as arguments.
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

"Matthew Pfluger" wrote in
message ...
Can I open a new instance of a form and move it to a new record? If so,
could any problems arise if a user opens two instances in this way (set to
new records)?

Thanks,
Matthew Pfluger




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:35 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.