Compile Error

10 pts.
Tags:
Compile error
Database programming
Microsoft Access
I am trying to prevent duplicate job orders from being entered for the same employer. The employer is in the main form and the job order is in the subform. I have this code attached to the "beforeupdate" event of the control on the subform but I get a compile error: wrong number or arguments or invalid property assignment. Can you see what is wrong? If Not IsNull("[PositionType]", "JobOrderInfo", "[EmployerID] = " & Me.EmployerID & " AND [PositionType] = """ & Me.PositionType & """") Then MsgBox "Already There" Cancel = True Me.Undo End If
ASKED: August 28, 2008  7:55 PM
UPDATED: August 30, 2008  9:05 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Is it possible that you mean
<pre>If Not IsNull(DLookup(“[PositionType]“, “JobOrderInfo”, “[EmployerID] = ” & Me.EmployerID & ” AND [PositionType] = “”" & Me.PositionType & “”"”) )Then
</pre>
as the intended code?

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following