Hi. Glad you got this working. When you refer to a subform control value you are referring to the currently-active record, not all records, hence the transfer of just one venue address. If you want to transfer all venue addresses you really need to take a different approach. You could use a loop in code to process a copy of the subform's recordset, which is normally already filtered by the parent-child field link to the main form.
A skeleton for the code for this is shown below:
- Dim rstVenues as DAO.recordset
-
Dim VenuAddresses as String
-
Dim Addresscount as Integer
-
-
Set rstVenues as Me![SUBFRM_VENUE].Form.Recordsetclone
-
Do while not rstVenues.EOF
-
Addresscount = Addresscount + 1
-
If Addresscount = 1 then
-
VenuAddresses = rstVenues![Venu_Address]
-
Else
-
VenuAddresses = VenuAddresses & "; " & rstVenues![Venu_Address]
-
End If
-
rstVenues.Movenext
-
Loop
-
rstVenues.Close
You may need to add a reference to the MS DAO 3.x object library (if compiler does not recognise the DAO.Recordset statement) - from VB editor choose Tools, References and tick the highest-numbered MS DAO object library.
-Stewart