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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

option group choose function 1

Status
Not open for further replies.

patrichek

MIS
Nov 18, 2003
632
US
Hi,
I have a report that shows name, phone and type of insurance. Insurance type is an option group and on the report i have this choose statement so the option group shows up as text instead of a number:

=Choose([InsuranceType],"Medicare","Global/Private","Medicare/Sup","LOP","LOP","Global Self-Pay","Work Comp","Auto")

the problem is that if a user doesn't select an option i get an "error" on my report. How can i tell access that when nothing is selected not to include this contact in the report?

thanks in advance!
 
I thought of that but the users add alot of data and one less step would be nice for them.
 
That would not be a step for them. If they don't make a choice, it would revert to the default. If you set the default to nothing, you can handle it anyway you want in your code.
 
oic, thanks i'll try that. It won't be until week after next as I'm on a much needed vacation next week.
thank you for the idea! I'll make sure you'll get a star if it works!
 
No problem. If it does not work, just come back and let us know.
 
Have you tried something like:
=Choose(Nz([InsuranceType],9),"Medicare","Global/Private","Medicare/Sup","LOP","LOP","Global Self-Pay","Work Comp","Auto","n/a")

I would expect that Insurance types might change at some point in the future so I would never use a Choose() function in an expression that I might need to modify some day in the future.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top