Results 1 to 6 of 6
  1. #1
    Mister-B is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    31

    Read Data from Sub Form and copy it to Text Boxes


    Hi,

    I'm new to access and am trying to solve the following problem. On my Form "Daten" I have a Sub Form "BewerberUF". The sub form is shown as a table and has no more than 10 entries. How can I get the values from the table to be copied onto other text boxes on the same Main form? I would like the values from the second and third columns from the first row of the sub form table to be copied into textbox1, the values from the second line of the table to be copied into textbox2 and so on down to textbox10. Can somebody help me out with this problem, please? It's causing sleepless nights!

    Regards,
    Martin

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    if the data is in the subtable, why do you want it in the Master table?

  3. #3
    Mister-B is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    31
    The data in the textboxes is used to fill the "Recipients" line of an outlook email using VBA. Up until now I typed the values into the textboxes manually. I don't know of another way to get these values into a state where I can use them with VBA

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    If you see it on a form, vb can see it.
    Just reference it:
    forms!myMasterform!subform!form!txtBox

    or you can 'copy' them to the master form in the ON CURRENT event of the subform. (when you select the subform record)
    Code:
    sub Form_Oncurrent()
     forms!myMasterform.txtBox1 = forms!myMasterform!subform!form!txtBox1
     forms!myMasterform.txttBox2 = forms!myMasterform!subform!form!txtBox2
    end sub

  5. #5
    Mister-B is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    31
    I don't follow. The data in the sub form is in a table. That's my whole problem. I need to be able to loop throught the table and somehow get the data from the required columns of the table into some state that I can work with it.

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You should tell us more about the process and the desired output in order to get more focused answers. Sounds like you don't really want to populate form textboxes. You want to get records from a table based on some value on a form, or you only want to get some of the fields from the records that are already on a form. How you would want to send that will make a difference because you can output table or query results in more than one format or method.

    You might only need something as simple as a new query that only gets the fields you need based on a form or subform value, and then output that in an email.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 3
    Last Post: 04-24-2018, 11:42 AM
  2. Replies: 2
    Last Post: 11-07-2012, 08:29 PM
  3. Replies: 5
    Last Post: 02-21-2012, 07:33 AM
  4. Replies: 1
    Last Post: 07-23-2011, 11:51 PM
  5. Replies: 3
    Last Post: 07-23-2011, 12:45 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