Command button indicates records in query

Wayne Cramer

Registered User.
Local time
Today, 16:37
Joined
Aug 10, 2007
Messages
93
I have a continuous form that shows quote information for a geographical area. On this form is a command button that opens a form based on a query based on a linked table from another database. The related field is purchase order item number. The form shows communication between the company and the vendor on issues for the selected purchase order item number. This works great. The operator clicks the button and sees all the vendor / company correspondence. The client would like the command button to either indicate that there are records for the selected PO line item such as a color change (ie. if the text is red there is no correspondence or if it is black correspondence exists) or that the command button :confused not appear if there are no recortds in the underlying query. Is either of these options possible?
 
Thanks Fifty2One. Here's where I get lost. The command button on form A opens form B where the link criteria is the PO and item match.

stDocName = "frmIssues2"
stLinkCriteria = "[PO#Line#]=" & "'" &Me![PO and Line] & "'"

If there is a match then form B shows the correspondence that has taken place. If there is no match it's a blank form. What the client wants is if there are records that meet the criteria then there is a button and if not there is no button.
So, it seems I need to somehow verify that frmIssues2 actually has records meeting the condition that the PO Item field match and if so the button is available and if no the button is not available.
 
Thanks Fifty2One. I think I need to clarify my problem a bit. Form A is a continuous form with an enty for each Purchase Order/Line Number with info sucha as qty ordered, price matl description etc. On this form is the command button which opend Form B which shows the corresponcence concerning issues with that particular Purchase Order/Line Number.

stDocName = "frmIssues2"

stLinkCriteria = "[PO#Line#]=" & "'" & Me![PO and Line] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

The form opens and if there are records they are displayed and if not a blank form opens up. The client woulf like the button to be visible if Form B has records matching the Purchase Order/Line of From A and to be invisible if it does not have records meeting the link criteria. In essence they only want to see the button if there is something to look at. So, how do I determine if there are records in the dataset?
 

Users who are viewing this thread

Back
Top Bottom