The following code I was hoping, would write to another field in the newly created record, entered on sub-form, There are only 2 events listed, associated with the subform ( one being the 'Exit' used here ) The procedure doesn't run, as checked, by using 'Dim x' etc. to check.
It doesn't execute.
Code:
Private Sub sfrmRefs_Exit()
Dim x As Integer
x = 0
Dim dt As Date
Dim IdString As String
x = 1
With Me!sfrmRefs.Form.Recordset
.Edit
' Store entered referral date in variable - dt
dt = !Referral_Date
' Create concatenated string for new Referral_ID, from Client_ID, Client initials and ref_date
IdString = CStr(cl & Left(Me!Parent!txtForename.Text, 1) & Left(Me!Parent!txtSurname.Text, 1) & Format(dt, ddmyy))
Me!Parent!txtTest.SetFocus
Me!Parent!txtTest.Text = IdString
!Referral_ID = IdString
.Update
End With
End Sub
It doesn't execute.