copying a form

  • Thread starter Thread starter Jim VanGordon
  • Start date Start date
J

Jim VanGordon

Hey all. I've run into a problem trying to copy forms.
I've created a form that I like, but I need multiple
copies of it within the same Access file. The catch is
that all the copies will have different info. I guess
what I'm asking is can I copy/paste a form and tell it to
get it's info from a different table? And if so, how
would I go about doing this? I really don't want to
resort to recreating this form five times. If you have
any ideas I'd appreciate the help.

Thanks,

Jim VanGordon
 
Let me clarify. You have a form that can be used with many different
(matching) tables.

Maybe you should consolodate all those tables into one with a code field to
identify the different kinds of records (from the different tables). then
use the form with a filter to show the data you want. consolodating the
tables will also make comparitive analysis of the different kinds of records
more convenient. Keeping only one copy of the form will make future
development of the form less chaotic.

But you can copy the form give it different names and then go to the
recordsource property of the forms to point to different tables. The
easiest way is to open the form. change the record source and save it as a
different name.

Warning: if using Access 2000 and your form has embedded VB code (most
fancy forms do) be sure you compile your database everytime you copy a form.

Tom
 
Tom,

I like the idea of consolodating the tables into one with
a code field. How could I set up a form to automatically
store the value in the code field--so my user doesn't
have to manually enter it? I only know how to manipulate
text boxes and combo boxes...how do you store a value
behind the scenes? I probably need the baby steps version.

Thanks,
Daniel
 
To answer the original poster.....
Open the form in DESIGN view,
show the PROPERTIES if they aren't already visible
Go to the DATA tab....make sure you don't have any fields selected on the
form...just click off in the dark space somewhere...

The recordsource of the form is shown and can be changed to whatever other
query you like.

to answer the other question.....

you csn store the value in a field that is not displayed on the form..
You can also use the .tag property to sre a value..

however in this case you might not want to store it...
By using OPENARGS you could pass this value from whereever you open the form
eg...a Switchboard that opens the same form, (but with different data
criteria)
docmd.open acform "This Form",,,, "CompanyID=212"

This then will filter the form on opening. Note that a refresh, requery
might then take that away.

HTH
Mal.
 
Back
Top