T
tracktraining
Hi All,
I am trying to code the following procedure: Get the jobfunc assign to
empemail from empjob table. Compare the jobfunc to the new jobfunc being
assigned in the form. If the jobfunc being assigned to the empemail at the
form stage is the same with any of the jobfunc already assigned (stored in
empjob table), then exit a particular sub.
The following code is a outline of what I am trying to write. This code put
me in a continuous loop. =(
ChkJobFunc = "SELECT * FROM EmpJob WHERE EmpJob.EmpEmail = '" +
newEmpEmail + "'"
Set dbt = CurrentDb
Set rst = dbt.OpenRecordset(ChkJobFunc)
MsgBox rst!JobFunc
MsgBox Me.txtJobFunc
Do Until rst.EOF
MsgBox "not end yet"
If rst!JobFunc = Me.txtJobFunc Then 'when this is true, exit sub right
away
MsgBox "job function same" 'if not true ever, then perform
the other operation in the sub
Exit Sub
End If
Loop
please help if possible. thanks so much in advance.
Thanks,
Tracktraining
I am trying to code the following procedure: Get the jobfunc assign to
empemail from empjob table. Compare the jobfunc to the new jobfunc being
assigned in the form. If the jobfunc being assigned to the empemail at the
form stage is the same with any of the jobfunc already assigned (stored in
empjob table), then exit a particular sub.
The following code is a outline of what I am trying to write. This code put
me in a continuous loop. =(
ChkJobFunc = "SELECT * FROM EmpJob WHERE EmpJob.EmpEmail = '" +
newEmpEmail + "'"
Set dbt = CurrentDb
Set rst = dbt.OpenRecordset(ChkJobFunc)
MsgBox rst!JobFunc
MsgBox Me.txtJobFunc
Do Until rst.EOF
MsgBox "not end yet"
If rst!JobFunc = Me.txtJobFunc Then 'when this is true, exit sub right
away
MsgBox "job function same" 'if not true ever, then perform
the other operation in the sub
Exit Sub
End If
Loop
please help if possible. thanks so much in advance.
Thanks,
Tracktraining