If statment based on more than one factor

T

Thorson

I currently have the following code on one of my forms

Private Sub EarTag_AfterUpdate()
If (DLookup("CalfSex", "tblBirthInformation", "[EarTag]='" & Me![EarTag] &
"'") = "C") Then
DoCmd.OpenForm "frmTHE"
End If
End Sub

The code looks at the Eartag (text) that was entered into
frmDispositionRecordIndID, and compares it to another table, depending on the
sex of that animal in the other table it then opens up a form. I would like
to modify this code to that it does an additional check.

I would like it to also check frmDispositionRecords to see what the
"cboMethod" has for the record of the animal. The frmDispositionRecords and
frmDispositionRecordIndID are related through the record number. I would
like it to look at the matching record and if the only open the form in the
code if the record is "Sold", "Died" or "euthanized".

I'm not sure how to modify the code to do this. If someone could help out
that'd be great!
 
C

Clifford Bass

Hi Thorson,

What is the relation between frmDispositionRecords and
frmDispositionRecordIndID? Form/sub-form? If so, which is which? If not,
please explain.

Clifford Bass
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top