Results 1 to 11 of 11
  1. #1
    cabonegro is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    7

    Access 2003 - how to pass data from one from to an other

    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

  2. #2
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    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?

  3. #3
    cabonegro is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    7
    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!!

  4. #4
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    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.

  5. #5
    cabonegro is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    7
    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

  6. #6
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    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

  7. #7
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    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"

    Quote Originally Posted by cabonegro View Post
    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

  8. #8
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    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

  9. #9
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    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.

    Quote Originally Posted by pkstormy View Post
    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

  10. #10
    cabonegro is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    7
    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

  11. #11
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    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.


    Quote Originally Posted by cabonegro View Post
    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

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Pass data from one form to another
    By Bruce in forum Forms
    Replies: 16
    Last Post: 02-25-2013, 03:59 PM
  2. Replies: 1
    Last Post: 08-02-2010, 01:19 PM
  3. Replies: 6
    Last Post: 12-01-2009, 11:59 AM
  4. converting from Access 2003 to Access 2007
    By LawrenceLau in forum Access
    Replies: 6
    Last Post: 11-20-2008, 03:53 PM
  5. Replies: 1
    Last Post: 09-06-2006, 11:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums