Show / Hide Form Button

Cliff

Registered User.
Local time
Today, 05:10
Joined
Dec 2, 2008
Messages
18
I have a form that I want to act somewhat like a Switchboard.
If a user has records they need to audit, I want a button to show that they can click on to display the records. If they don't have any records to audit, I want it to say that in text instead.
The way i tried to solve it was with an iff statement, but that didn't work.

=IIf(Count([Patients.patient_user_pk])>1,[Forms].[Show_Records].[ShowRecords],'You do not have any records to audit at this time.')

Any suggestions?

Thanks, Cliff
 
I think you should reference a valid recordset source instead of the form.

=IIf(Count([Patients.patient_user_pk])>1,>Valid recordset name<,'You do not have any records to audit at this time.')

???
 
Use the "Dcount" function in the "Form Open" event. If the count is 0 (zero) you can set the enabled property of the button to false. You can also have a pop-up message to inform the user that there are no records to display.

Your post did not say, how the records would be displayed if the count is greater than one. I usually use a subform in datasheet view where you can access the specific record by double clicking.
 

Users who are viewing this thread

Back
Top Bottom