Results 1 to 9 of 9
  1. #1
    ryanmce92 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    48

    Button to have same data as previous form.


    I'd like to have a button on my form which when clicked will bring up a new form but with the same data.

    For example I have a customer database and a form "Add A New Customer", each of these customers have specific products, I want the customer name and location to be in the next form but that is all.

    Any help would be great whether it would be a query or VBA code.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    So the scenario is that you have FORM A. On that form you have some data. When you open FORM B you want the the same data from FORM A to show on FORM B.

    If FORM B will ONLY be open when FORM A is also open you can reference a specific field using a formula like:

    =[forms]![FORM A]![FIELD NAME]

    in a text box on FORM B

  3. #3
    ryanmce92 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    48
    Quote Originally Posted by rpeare View Post
    So the scenario is that you have FORM A. On that form you have some data. When you open FORM B you want the the same data from FORM A to show on FORM B.

    If FORM B will ONLY be open when FORM A is also open you can reference a specific field using a formula like:

    =[forms]![FORM A]![FIELD NAME]

    in a text box on FORM B
    No, sorry for my poor explanation.

    I only have the one form, it is entering data into a row on a table, once I hit a button I want the data I have entered to be stored and the same form open but with the fields customer name and country filled out?.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    I have no idea what you're asking now.

    If you are using a BOUND form you can set the CYCLE propery to CURRENT RECORD, then, unless you use the mousewheel, your cursor will never leave the 'current' record (the one you just entered)

    If you are using combo boxes and picking a vendor, but want their, for instance, address to appear on the form you can use a lookup query to run the form, they SHOULD NOT be values that are stored as part of your data entry, you should only need to store the vendor ID (Primary key field) and be able to perform the lookups as needed for reports, billing, forms, etc.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    ryanmce92,

    I agree with rpeare
    I have no idea what you're asking now.
    I'm going to suggest you don't start with a button on a form which when clicked will bring up a new form but with the same data.
    Give the reader some context. If you give readers a 30,000 foot overview, they can help put things together. Without some such description, all readers can do is guess what your issue is. You will get focused and directed responses once readers clearly understand the problem.
    What is your database about? What "things" does it involve? How do the things relate to each other?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You want to move to a new record row and have the customer name and location from the record just saved carried forward? If the form is to add a new customer, this makes no sense.

    What is really the purpose of this form? Are you adding records for customer order?

    Sounds like need a form/subform arrangement. Really need to know more about data structure and form purpose.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    ryanmce92 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    48
    Ok, like I said I'm new to this so any help posting etc. would be great.

    So the database I have created is a supplier database.

    I have a form connected to this table which will add data once entered.

    The primary key in the table is an autonumber.

    The number reflects a supplier and a product.

    I already have a button on the form called add new supplier which creates a new record.

    However, I now want another button on the form called "add a new product to this supplier", I want this button to save the current data entered and open a new record in the form and generate a new autonumber, but with the supplier name and location carried forward to the next form.

    Hopefully this makes more sense, apologies for being too vague previously.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Customers or Suppliers?

    Do you have a table for suppliers? Do you have a table for products? Do you have a third table that associates suppliers with products? That would be the normal structure for a many-to-many relationship. So let's verify the relationship. Obviously each supplier can have many products. Can each product be associated with multiple suppliers?

    Conventional options for data entry would be:

    1. one form bound to the third table with comboboxes to select supplier and product

    2. main form bound to Suppliers and subform bound to third table with combobox to select product

    3. main form bound to Products and subform bound to third table with combobox to select supplier

    Review https://support.office.com/en-US/Art...rs=en-US&ad=US. No code required.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    ryanmce92 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    48
    Quote Originally Posted by June7 View Post
    Customers or Suppliers?

    Do you have a table for suppliers? Do you have a table for products? Do you have a third table that associates suppliers with products? That would be the normal structure for a many-to-many relationship. So let's verify the relationship. Obviously each supplier can have many products. Can each product be associated with multiple suppliers?

    Conventional options for data entry would be:

    1. one form bound to the third table with comboboxes to select supplier and product

    2. main form bound to Suppliers and subform bound to third table with combobox to select product

    3. main form bound to Products and subform bound to third table with combobox to select supplier

    Review https://support.office.com/en-US/Art...rs=en-US&ad=US. No code required.
    Thanks for the information, I'll have a look now.

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

Similar Threads

  1. Replies: 1
    Last Post: 05-31-2013, 08:53 AM
  2. Replies: 1
    Last Post: 11-14-2012, 02:38 PM
  3. Replies: 1
    Last Post: 12-21-2011, 02:11 PM
  4. Replies: 4
    Last Post: 09-09-2011, 10:00 PM
  5. Replies: 3
    Last Post: 10-22-2010, 06:53 PM

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