Eljefegeneo
Still trying to learn
- Local time
- Today, 09:07
- Joined
- Jan 10, 2011
- Messages
- 902
I have two fields in a table, one is RecordID, the primary Key and the other is SequenceNumber. A SequenceNumber can appear one or two times. If there are two entries for the same SequenceNumber, then I want to know the larger number of RecordID and the smaller number. What I want to do is if I enter an new record with the same SequenceNumber, I can update two T/F fields on the smaller RecordID number and one on the larger RecordID number.
So first I tried to figure out are there were more than two records with the same SequenceNumber. I tried the following in an unbound text box a form to see what code would work for me:
But I get the #Name? error
Then I tried :
But I get the same error message. In both cases, when I paste the code into the control source, go back to the form and see the error #Name?, the code reverts to [Me]![SequenceNumber] after the "&" in the code and I am wondering why and if this is the problem and what am I doing wrong.
So first I tried to figure out are there were more than two records with the same SequenceNumber. I tried the following in an unbound text box a form to see what code would work for me:
Code:
= IIF(DCount("[SequenceNumber]", "tblRegularInvoices2", " SequenceNumber = " & Me!SequenceNumber) >=2, True, False)
Then I tried :
Code:
= IIF(DCount("*", "tblRegularInvoices2", " SequenceNumber = " & Me!SequenceNumber) >=2, True, False)