wow...this got confusing again...(and more complicated then i
suspected). the subform that has the "send to Accting and print inv"
field only has 1 record there is a 1:1 relationship there. (i don't
know if this matters but there is another subform which does have a 1:M
relationship but nothing on this subform pertains to this problem).
I'll try what you suggested.
Tks again for walking me through this.
Steve
This is not the problem you originally presented. At first you said
1) the user hits the command button to open FORM A
2) the program actually opens FORM 1 and looks to see if checkbox 1 is
yes or no
3) if yes then the program opens FORM A, if no the programs opens FORM
B
but your latest description (below) says in effect
1) the user hits the button command192 on form "General Quote".
2) this is supposed to open one of two forms "profit tracking 2" and
"profit tracking 3"
3) if the checkbox "send to Accting and print inv" on the "inv status"
subform on "profit tracking 2" would be checked if "profit tracking 2"
form were opened at the record in its recordset that matches the
current
record in the "General Quote" form, open "profit tracking 3".
Otherwise,
open "profit tracking 2".
One of the things you haven't revealed is how the records displayed by
the "inv status" subform are related to the records displayed by its
parent form "profit tracking 2". Subforms are normally used to display
1:M relationships - in which case one record in "profit tracking 2"'s
recordset can have many related records in the subform, and presumably
the value of the "send to Accting and print inv" checkbox will depend
on
which of these records you look at.
The general idea remains the same: use DLookup to get the value of the
field corresponding to the checkbox. But if - as I presume - there are
related tables underlying the form and subform, you'll need to start by
creating a and saving query that joins these tables and returns two
fields:
1 [ref link] from the table underlying [profit tracking 2].
2 for each value of [ref link], the corresponding value of the
field in the table underlying [inv status] to which the checkbox
"send to Accting and print inv" is bound.
Then use DLookup to get the value of the checkbox from the query, using
something like this as the WhereCondition.
"[ref link] = " & Forms![General Quote]![Ref #]
or if these are text fields
"[ref link] = '" & Forms![General Quote]![Ref #] & "'"
Or maybe the field name should be [Ref # ], which is what you've mostly
said it is.