Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show / Hide Form Button

Status
Not open for further replies.

CTR

Technical User
Nov 15, 2001
42
US
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

_____________

Cliff
 
First, you would probably want it to be >0. If you have it at >1, there could be one record to audit, but it won't prompt the user.

On a form I have, in my unbound text field -> =count([requests]) (txtRequestCount)

The form's control source is a table. On the load event of your form, you could try something like:

Create an ubound field that would contain: =count([patient_user_pk]). Name it something like: txtPatientCount

Then, on the load event of your form:
if me.txtPatientCount <1 then

msgbox "No records to audit"

else

me.(your command button).visible = true

end if

And the command button would then requery the form or display a report with the records that are needed to audit.

This might not be accurate, but hopefully it gets you on the right path....?

Steven
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top