Results 1 to 5 of 5
  1. #1
    MJ_Cottle is offline Novice
    Windows 11 Access 2016
    Join Date
    Sep 2023
    Posts
    3

    Combine email table column into one unbound text box on form

    Good Day~
    How do I combine all emails from table column into one unbound text box on form with Access VBA On Open?


    email1@abc.com; email2@abc.com; email3@abc.com; email4@abc.com; etc...
    Any help will be much appreciated!!!!

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    5,012
    Use a recordset and append each field of every record with the required separator.
    Tip: It does not matter if you end up with a separator at the end of the string. The mail will still be sent.
    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

  3. #3
    MJ_Cottle is offline Novice
    Windows 11 Access 2016
    Join Date
    Sep 2023
    Posts
    3
    Like this:
    Private Sub Form_Open(Cancel As Integer)
    Dim rst As DAO.Recordset
    Dim BudgetSingleAmount As Double
    Dim SQL As String


    SQL = "SELECT [2dCheck] FROM [_UNMATCH ONSLOW EMAIL]"




    Set rst = CurrentDb.OpenRecordset(SQL)


    Me.CHE.Value = rst![2dCheck] & ";"


    rst.MoveNext
    Loop
    rst.CLOSE
    Set rst = Nothing


    End Sub

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,123
    Use a concatenation function as the control source for the unbound textbox:

    SimpleCSV() function: https://www.accessmvp.com/thedbguy/c...itle=simplecsv
    Allen Browne's concatenate function: http://allenbrowne.com/func-concat.html
    I also have a verion (JoinFromArray) on my site: https://forestbyte.com/vba-code-samples/

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    MJ_Cottle is offline Novice
    Windows 11 Access 2016
    Join Date
    Sep 2023
    Posts
    3
    Perfect!!!! Thank you ever so much

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

Similar Threads

  1. Replies: 2
    Last Post: 06-22-2019, 02:26 PM
  2. Replies: 1
    Last Post: 06-15-2018, 04:21 PM
  3. Replies: 10
    Last Post: 03-16-2018, 08:26 AM
  4. Avg a column of unbound text boxes
    By JRT2006 in forum Forms
    Replies: 6
    Last Post: 05-08-2015, 10:32 AM
  5. Replies: 2
    Last Post: 03-10-2015, 11:47 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