Results 1 to 4 of 4
  1. #1
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102

    Transferring Values from Form too table

    Hello everyone,




    I have this form:
    Click image for larger version. 

Name:	Screenshot 2022-10-13 082204.png 
Views:	14 
Size:	24.4 KB 
ID:	48897
    ,in this form data is entered by the user, I have a button called "cmdSave", this button should save the entered data in a table.
    For example "No. 1" in the screenshot should be row 1 in the table, "No. 2" should be row 2 and so on. "1.1" should then be the first column, 1.2 the second and so on.


    The table looks like this:
    Click image for larger version. 

Name:	Screenshot 2022-10-13 082725.png 
Views:	14 
Size:	6.6 KB 
ID:	48896
    What would the code look like to save all this?


    Thanks for your help!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    You want to limit users to entering 6 records?

    This is not the best way to design a data entry form, and I think you have already been advised this in another thread.

    Why do you want to do this as opposed to using a form bound to table and controls bound to fields?

    Why do fields have non-informative names like 1_1?
    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.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,574
    Quote Originally Posted by Akchayan View Post
    What would the code look like to save all this?
    !
    Bit of a mess I would have thought.

    You would need to construct an append query for each row.
    Best name the controls with 1 to six suffix so tou could use a loop.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180
    IMO : Best way to do this is to create an object layer: for each table you want to fill in you create an object with an update/insert/delete/search method. You can than use these objects to manage your data from the forms. Objects can be created with class modules.

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

Similar Threads

  1. Replies: 3
    Last Post: 06-15-2017, 12:14 PM
  2. Replies: 2
    Last Post: 08-27-2014, 12:12 PM
  3. Replies: 9
    Last Post: 12-27-2011, 01:06 PM
  4. hyperlink data not transferring to destination table
    By markjkubicki in forum Programming
    Replies: 3
    Last Post: 09-17-2010, 06:12 PM
  5. Transferring data from table to table.
    By jlm722 in forum Import/Export Data
    Replies: 6
    Last Post: 09-30-2009, 06:16 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