How to deactivate a command button if record in a query

D

doyle60

I want to have a command button on a form to be activated only one
there are no records in a certain query. What is the code for this?
I used to have it but no longer have access to that database.

Thanks,

Matt
 
D

doyle60

Thanks. I wanted it to run after the user pressed another command
button. I changed the typoed period to a comma, and retranslated it
into this:

If DCount("*", "CheckIfInputtedAlreadyqry") > 0 Then
Me.Command6.Enabled = False
Else
Me.Command6.Enabled = True
End If

I had a bit of trouble with it at first because I didn't put the query
name in quotations.

Thanks,

Matt
 

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