If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Count Instances in a table field
Here's a little background on my database. I have a form with a couple of
buttons that I have grayed out when the database is empty. These buttons open a print preview of a couple of reports. I would like to ungray these buttons only when there is at least one record with a "CA" entry in the State field in my main table. How do I do this? |
#2
|
|||
|
|||
Count Instances in a table field
Forms display data from tables. I'm not understanding why you'd want a form
to enable (ungray) a button if ANY record has a "CA" entry. Wouldn't you want to ungray the form if the record DISPLAYED had "CA"? Since I'm not there, I don't have a clear idea on what your business need might be... Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "gagecres" wrote in message ... Here's a little background on my database. I have a form with a couple of buttons that I have grayed out when the database is empty. These buttons open a print preview of a couple of reports. I would like to ungray these buttons only when there is at least one record with a "CA" entry in the State field in my main table. How do I do this? |
#3
|
|||
|
|||
Count Instances in a table field
Never mind. I figured it out. I used the DCount function in an If statement:
If DCount("*", "Property Table", "[STATE] = 'CA'") 0 Then Me.cmd_Prnt_All_CA_Ltrs.Enabled = True Me.cmd_Prnt_Unprntd_CA_Ltrs.Enabled = True End If "gagecres" wrote: Here's a little background on my database. I have a form with a couple of buttons that I have grayed out when the database is empty. These buttons open a print preview of a couple of reports. I would like to ungray these buttons only when there is at least one record with a "CA" entry in the State field in my main table. How do I do this? |
Thread Tools | |
Display Modes | |
|
|