N
Nathan Lee
I think this should be simple, but I can't figure out how to do it.
I have a form, where after updating a field, I need to make sure it's
unique. The table allows multiples of this field, called "UniqueID", but
they must have a different revision number, called "Revision". If the
user tries to enter a new record with the same pairing of "UniqueID" and
"Revision", I need to bring up a message box.
More distinctly:
If Me.uniqueIDField.Value and Me.revisionField.Value exist in the same
record, then MsgBox("Please enter a distinct UniqueID").
Can I do this? I'd really prefer to keep this in regular old VBA, so if
I can avoid using SQL, it would be pretty nice. I could just see if the
UniqueID exists in the table, and then for all records where it does,
check if the Revision exists in the same record. Is there a VBA
procedure that checks whether a value exists in a specific field in a table?
Nathan
I have a form, where after updating a field, I need to make sure it's
unique. The table allows multiples of this field, called "UniqueID", but
they must have a different revision number, called "Revision". If the
user tries to enter a new record with the same pairing of "UniqueID" and
"Revision", I need to bring up a message box.
More distinctly:
If Me.uniqueIDField.Value and Me.revisionField.Value exist in the same
record, then MsgBox("Please enter a distinct UniqueID").
Can I do this? I'd really prefer to keep this in regular old VBA, so if
I can avoid using SQL, it would be pretty nice. I could just see if the
UniqueID exists in the table, and then for all records where it does,
check if the Revision exists in the same record. Is there a VBA
procedure that checks whether a value exists in a specific field in a table?
Nathan