Hello,
I'm fairly new to Access and at the final stages of completing a DB. It has a main table without too much relational stuff going on, the main feature is a form that constrains user input.
It's for captive bird post mortem data, I have a text box field on the main table called RINGNO where the ring numbers of dead birds are entered when they die. I want to maintain a second table in which users enter ring numbers of birds who have been tested and found to have disease when alive so that when they die the ring number, before update, is flagged by a message box to say 'this bird was ill' type thing.
So my question is how can I link these two tables. I'm not at all adept at coding but by scrathing around the internet I've found some code that uses DCount to highlight duplicate ring numbers within the same table, but not sure how to do this across two tables, Dcount can't do this i understand.
Private Sub txt_RINGNO_BeforeUpdate(Cancel As Integer)
If DCount("*", "CAPTIVE", "RINGNO = '" & Me.txt_RINGNO & "'") > 0 Then
MsgBox "Warning: this ring number already exists."
Cancel = False
End If
Any help would be greatly appreciated. Thanks
I'm fairly new to Access and at the final stages of completing a DB. It has a main table without too much relational stuff going on, the main feature is a form that constrains user input.
It's for captive bird post mortem data, I have a text box field on the main table called RINGNO where the ring numbers of dead birds are entered when they die. I want to maintain a second table in which users enter ring numbers of birds who have been tested and found to have disease when alive so that when they die the ring number, before update, is flagged by a message box to say 'this bird was ill' type thing.
So my question is how can I link these two tables. I'm not at all adept at coding but by scrathing around the internet I've found some code that uses DCount to highlight duplicate ring numbers within the same table, but not sure how to do this across two tables, Dcount can't do this i understand.
Private Sub txt_RINGNO_BeforeUpdate(Cancel As Integer)
If DCount("*", "CAPTIVE", "RINGNO = '" & Me.txt_RINGNO & "'") > 0 Then
MsgBox "Warning: this ring number already exists."
Cancel = False
End If
Any help would be greatly appreciated. Thanks