D
doyle60
What is the best procedure to make a command button bold if an
unrelated table---one not drawn up in a subform or into the query the
form is based on---has a related record.
The Main Form:
Record Source: OrderHeaderqry
The Key Field: PO (Text)
The Unrelated Table:
CompPOListtbl
The Key Field: CompPO (Text)
So when I am on the main form and I move to a new record (say) PO
12222 and if there is a 12222 in the CompPO field of the
CompPOListtbl, I want the Command5425 button to be bold. If there is
not a 12222, I want Command5425 to be normal.
I had this working using an invisible sub and an invisible field on
the main to bring in the number of lines on the invisible sub and
having this on current code:
If CountOfCompPOID2 = 1 Then
Command5425.FontWeight = 700
Else
Command5425.FontWeight = 400
End If
And if worked beautifully. But when I signed on as a user that did
not have permission on the subform data, I got an error. So I need to
rethink this and get a bit smarter.
So can I do this with just code (and without bringing the
CompPOListtbl table into the OrderHeaderqry query)?
Thanks,
Matt
unrelated table---one not drawn up in a subform or into the query the
form is based on---has a related record.
The Main Form:
Record Source: OrderHeaderqry
The Key Field: PO (Text)
The Unrelated Table:
CompPOListtbl
The Key Field: CompPO (Text)
So when I am on the main form and I move to a new record (say) PO
12222 and if there is a 12222 in the CompPO field of the
CompPOListtbl, I want the Command5425 button to be bold. If there is
not a 12222, I want Command5425 to be normal.
I had this working using an invisible sub and an invisible field on
the main to bring in the number of lines on the invisible sub and
having this on current code:
If CountOfCompPOID2 = 1 Then
Command5425.FontWeight = 700
Else
Command5425.FontWeight = 400
End If
And if worked beautifully. But when I signed on as a user that did
not have permission on the subform data, I got an error. So I need to
rethink this and get a bit smarter.
So can I do this with just code (and without bringing the
CompPOListtbl table into the OrderHeaderqry query)?
Thanks,
Matt