Hi everyone,
I'm a newbie and I'd like to know how to pass data from one form to an other?
I have similar information in 2 forms and I'd like to have the same information imported from FORM 1 to FORM 2.
Please help.
Thanks
Hi everyone,
I'm a newbie and I'd like to know how to pass data from one form to an other?
I have similar information in 2 forms and I'd like to have the same information imported from FORM 1 to FORM 2.
Please help.
Thanks
I'm not sure what you're asking. Are you talking about a main form and a sub-form? For example in your main form, you may have customer informaton, e.g. Name, Address etc. and in the sub-form you would have all the purchases made for each customer. Are you trying to do something along these lines?
Thanks for your reply, what I'm trying to do here is from the main form I open a second form that has some fields that are similar to the main one. Main Form has all contact information business name, Project number, first and last name, address... the second form is for different purpose but has business name and project number that I'd like to import once I hit the open button from Form.
Please let me know if I'm not clear!!
It sounds like you do not have it setup correctly. What exactly is the intent of the database? I saw you typed project, so I'm assuming some type of project database. In that case, you would need a separate table for your projects.
For example I have two tables (Table1 and Table2) and I use forms (Form1 and Form2) to enter data. There is a numeric field in Form1 and Form2 named "BusinessNumber". After completing data entry on Form1, I use a command button to open Form2 and I want the "BusinessNumber" field to be automatically entered in the "BusinessNumber" field in Form2.
Thanks
After you open Form2, you could use syntax like this (referencing the form and field itself):
docmd.openform "Form2"
Forms!Form2!BusinessNumber = Forms!Form1!BusinessNumber
(Or if it's on a subform)
Forms!Form2!BusinessNumber = Forms!Form1!MySubformName!BusinessNumber
You should not have to do all that. You want it in a relational model. It sounds like you're trying to put together a project management type database. So, you want to have it setup something like this with the tables and fields.
Tables:
Businesses - BusinessID(Auto-Number unique identifier), Business Name, Address, Point of Contact, E-Mail, Phone etc.
Projects - ProjectID(Auto-Number unique identfier), Project Name, Description, Start Date, Budget, End Date, CustomerID etc.
You would set a one-to many relatinship between the BusinessID and the CustomerID. You could then create a main form using your Businesses table and a sub-form using the Projects table. You would set a Master/Child relationship on the sub-form between the BusinessID and the CustomerID. This would automatically tie the projects to the corresponding customer.
If you're not familiar with this, I would suggest just doing a little research on relational databases and use of main and sub-forms. Theres a ton of tutorials out there.
For example, you might have a "Customers" table. In this table you'll have information that is constant e.g. Customer Name, Phone #, Address etc. You would have a unique identifier field such as an Auto-ID, we'll call it "CustomerID"
For example I have two tables (Table1 and Table2) and I use forms (Form1 and Form2) to enter data. There is a numeric field in Form1 and Form2 named "BusinessNumber". After completing data entry on Form1, I use a command button to open Form2 and I want the "BusinessNumber" field to be automatically entered in the "BusinessNumber" field in Form2.
Thanks
Wow. I thought the question posed was simply how to copy data (an ID or some number) from one form into another (Form1 to Form2).
If it involves setting up relationships, designing subforms and such, the tips here might be helpful: http://www.dbforums.com/6366815-post77.html
http://www.dbforums.com/microsoft-ac...de-bank-6.html
Sometimes newbies post on here who are not familiar with Access and relational databases, so we should try to point them in the right direction, so they have it set up correctly from the get go, so it does not end up being a nightmare down the road.
Wow. I thought the question posed was simply how to copy data (an ID or some number) from one form into another (Form1 to Form2).
If it involves setting up relationships, designing subforms and such, the tips here might be helpful: http://www.dbforums.com/6366815-post77.html
http://www.dbforums.com/microsoft-ac...de-bank-6.html
Thanks guys for your support I think my question wasn't clear enough however I found a solution to my problem and it's a lot similar to what "pkstormy" replied with.
------------------
After you open Form2, you could use syntax like this (referencing the form and field itself):
docmd.openform "Form2"
Forms!Form2!BusinessNumber = Forms!Form1!BusinessNumber
(Or if it's on a subform)
Forms!Form2!BusinessNumber = Forms!Form1!MySubformName!BusinessNumber
I'm glad that you found a solution but I'm not sure it's the right solution from what I can gather on how your tables are setup. If the tables are not setup correctly, it can prove to be a nightmare down the road.
Thanks guys for your support I think my question wasn't clear enough however I found a solution to my problem and it's a lot similar to what "pkstormy" replied with.
------------------
After you open Form2, you could use syntax like this (referencing the form and field itself):
docmd.openform "Form2"
Forms!Form2!BusinessNumber = Forms!Form1!BusinessNumber
(Or if it's on a subform)
Forms!Form2!BusinessNumber = Forms!Form1!MySubformName!BusinessNumber