B
Bonnie
Using AXP. Need my subform to tell me on the BeforeUpdate
event of SSN field if it already exists. I wrote:
If (Not IsNull(DLookup("Employee_SSN", "Distribution
Table", "Employee_SSN = Forms!Distribution Form-Main!
Distribution Form-Sub1-Base!txtEmployee_SSN "))) Then
MsgBox "That SSN is already in the DataBase. Are you
sure you need to create another record? Press the Escape
key to exit this new record and check existing records
before creating another."
Cancel = True
End If
I'm getting a 'syntax error (missing operator)on
Employee_SSN = Forms!Distribution Form-Main!Distribution
Form-Sub1-Base!txtEmployee_SSN'
I know it is something simple and derives from the fact
that I have spaces in my field and form names.
My field is Employee SSN
My table is Distribution Table
My mainform is Distribution Form-Main
My subform is Distribution Form-Sub1-Base
I received the code from Arvin Meyer who was so nice to
help me but it was days ago and I don't know if he has the
thread open to help me again on this and I need to figure
it out. I wasn't sure why the letters 'txt' are in front
of the field name but took it on faith. Also, what does
the Cancel=True do? Not allow the new entry? We rarely
have 2 distributions for one SSN but need to allow for it.
I hope someone out there is bored enough to want to help a
non-programmer with this. Thanks in advance for any help
or advice.
event of SSN field if it already exists. I wrote:
If (Not IsNull(DLookup("Employee_SSN", "Distribution
Table", "Employee_SSN = Forms!Distribution Form-Main!
Distribution Form-Sub1-Base!txtEmployee_SSN "))) Then
MsgBox "That SSN is already in the DataBase. Are you
sure you need to create another record? Press the Escape
key to exit this new record and check existing records
before creating another."
Cancel = True
End If
I'm getting a 'syntax error (missing operator)on
Employee_SSN = Forms!Distribution Form-Main!Distribution
Form-Sub1-Base!txtEmployee_SSN'
I know it is something simple and derives from the fact
that I have spaces in my field and form names.
My field is Employee SSN
My table is Distribution Table
My mainform is Distribution Form-Main
My subform is Distribution Form-Sub1-Base
I received the code from Arvin Meyer who was so nice to
help me but it was days ago and I don't know if he has the
thread open to help me again on this and I need to figure
it out. I wasn't sure why the letters 'txt' are in front
of the field name but took it on faith. Also, what does
the Cancel=True do? Not allow the new entry? We rarely
have 2 distributions for one SSN but need to allow for it.
I hope someone out there is bored enough to want to help a
non-programmer with this. Thanks in advance for any help
or advice.