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!!!!
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!!!!
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
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
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,
Perfect!!!! Thank you ever so much