P
PayeDoc
Hello All
A simple problem here, I think (compared to the last one!).
In this code:
Dim missinginfo As String
If IsNull([DOB]) Then missinginfo = " date of birth."
If IsNull([NI number]) Then missinginfo = " National Insurance number."
If IsNull([NI number]) And IsNull([DOB]) Then missinginfo = " date of birth
or National Insurance number."
MsgBox ("We do not have a record of this employee's" & [missinginfo])
DoCmd.RunSQL "INSERT into employee_submissions (employee,submission_type)
Values([Forms]![staffs subform new]![employee_name],[missinginfo])"
.... the MsgBox action runs fine, and displays the expected value of
[missinginfo].
But the INSERT statement won't recognise [missinginfo] - access asks me for
this 'parameter value'. The record does get added to table
'employee_submissions', with the expected value of the 'employee', but not
with the [missinginfo] value.
I have tried removing the square brackets round 'missinginfo', but to no
avail.
Whats have I done wrong?
Thanks for any help.
Leslie Isaacs
A simple problem here, I think (compared to the last one!).
In this code:
Dim missinginfo As String
If IsNull([DOB]) Then missinginfo = " date of birth."
If IsNull([NI number]) Then missinginfo = " National Insurance number."
If IsNull([NI number]) And IsNull([DOB]) Then missinginfo = " date of birth
or National Insurance number."
MsgBox ("We do not have a record of this employee's" & [missinginfo])
DoCmd.RunSQL "INSERT into employee_submissions (employee,submission_type)
Values([Forms]![staffs subform new]![employee_name],[missinginfo])"
.... the MsgBox action runs fine, and displays the expected value of
[missinginfo].
But the INSERT statement won't recognise [missinginfo] - access asks me for
this 'parameter value'. The record does get added to table
'employee_submissions', with the expected value of the 'employee', but not
with the [missinginfo] value.
I have tried removing the square brackets round 'missinginfo', but to no
avail.
Whats have I done wrong?
Thanks for any help.
Leslie Isaacs