Error in my code and not sure what it is.

SD23

Registered User.
Local time
Today, 00:03
Joined
Jun 13, 2006
Messages
60
I keep getting an error on my code. the error says, cant find the field " refered in your expression. Basically i am trying to compare 3 fields with the same fields in the All Data Table. The three fields are dpre, dsug, and dnum. The data table is All Data Table. If the 3 fields are the same as 3 fields previously stored in the All Data Table, I want to have a message that says it already exists.


I appreciate your help. Thanks.



If Me.dpre = [All Data Table].[Docket No Prefix] And Me.dsuf = [All Data Table].[Docket No Suffix] And Me.dnum.Value = [All Data Table].[Docket No] Then
MsgBox "This is an Existing Docket number."

End If
 
forgot to remove the below in red.. have some patience man... sometime we miss the obvious... don't have to re-post if you are still having problem post your database so it can be looked at.

If Me.dpre = [All Data Table].[Docket No Prefix] And Me.dsuf = [All Data Table].[Docket No Suffix] And Me.dnum.Value = [All Data Table].[Docket No] Then
MsgBox "This is an Existing Docket number."
 
Just a quick reply is the primary key in the "All Data Table" made up of a composite key. Another words is the primary key of this table made up of the three fields dpre, dsug, and dnum. If this is the case there is a much simpler method than the one you are attempting above. Let me know, and I can point you to excellent threads on the forum which will assist you.

Regards
 

Users who are viewing this thread

Back
Top Bottom