M
Martin
Hello,
I have a combo box that selects a name of a department. Once this has been
updated I want to add to the same form a unique work reference ID into a
unbound column. I have a query working out the unique reference and I have
manged tio run this after the update. Here is the code:
Private Sub RATeam_AfterUpdate()
Dim SQL, Result As String
DoCmd.RunSQL "SELECT
I have a combo box that selects a name of a department. Once this has been
updated I want to add to the same form a unique work reference ID into a
unbound column. I have a query working out the unique reference and I have
manged tio run this after the update. Here is the code:
Private Sub RATeam_AfterUpdate()
Dim SQL, Result As String
DoCmd.RunSQL "SELECT
& IIf([RefNo Max] Is Null,'1',[RefNo Max]+1) AS
RefNo FROM qryTeamRefNo LEFT JOIN qryMaxofRefNo ON qryTeamRefNo.Team =
qryMaxofRefNo.[RA Team]"
Me!RefNo.Value = Result
End Sub
The problem I am having is that I do not know how to get the data from the
query into the unbound field call RefNo. Can anyone help?
Thank you.
Martin
RefNo FROM qryTeamRefNo LEFT JOIN qryMaxofRefNo ON qryTeamRefNo.Team =
qryMaxofRefNo.[RA Team]"
Me!RefNo.Value = Result
End Sub
The problem I am having is that I do not know how to get the data from the
query into the unbound field call RefNo. Can anyone help?
Thank you.
Martin