IIf Statement

  • Thread starter red skelton via AccessMonster.com
  • Start date
R

red skelton via AccessMonster.com

Hi,
I am wondering if anyone can help me out. I have a database that tracts
medical patients. I developed a form that has an option group with two check
boxes. This option group is used to tract who will be getting reimbursment
from the insurance company either the doctor or patient. The two boxes are
marked consultant (option value 1) and the other is marked patient (option
value 2). What I am trying to do is create an IIF statement where if I mark
check box 1, then on another form (which data source is a query) the
Consultant's name, address etc will display vs check box 2 if checked will
display the Patients name, address etc. the control source for the option
group is a table called "invoices" where I would like the name, address
stored in a row called Payment. I will include my IIF statement, but I'm not
exactly sure where I need to add the IIF statement, on the form under "after
update" or "after click" or exaclty where. Here is my statement;

=IIf([Payment]=1,"[table!invoices].[Payment]"="[table!tblConsultants].
[Consultant Name]" & "[table!tblConsultants].[Provider Co]" & "[table!
tblConsultants].[address1]" & "[table!tblConsultants].[address2]" & "[table!
tblConsultants].[address City Zip]","[table!Patient Info].[First Name]" & "
[table!Patient Info].[Last Name]" & "[table!Patient Info].[ADDRESS1]" & "
[table!Patient Info].[ADDRESS2]" & "[table!Patient Info].[ZIP_CODE]")

All information on addresses is contained in a consultant table or a patient
Info table.

I hope I have explained this clearly enough. I am a beginner at programming
and any help would be greatly
appreciated.

Thanks in advance,

Red
 
G

Guest

Personally, I would not do it that way. Based on the checkbox values, I'd
change the record source of the second form to include the appropriate
address. Presumably you have a command button to bring up the second form.
When the second form is opened, dynamically build the records source to
include whichever address you need.

Dorian.
 
R

red skelton via AccessMonster.com

Hi Dorian,

The form in question is an invoice. Currently, the form's control source is
a query that enters information such as patient name, Dr name, reason for
referral, cost etc. One of our staff then has to type in the name and
address that payment will be sent to either the Dr information or the
patient's information. I thought it would be easy (although, nothing is easy
it seems :>?) to automatically have this information entered according to the
option group boxes. The second form is called upon simply from the table
menu. Hope this makes sense and I'm explaining it ok. Sorry, when you say
dynamically build the records source to include whichever address, can you
expand this? Sorry for my ignorance. Thanks for the help.

Red
Personally, I would not do it that way. Based on the checkbox values, I'd
change the record source of the second form to include the appropriate
address. Presumably you have a command button to bring up the second form.
When the second form is opened, dynamically build the records source to
include whichever address you need.

Dorian.
Hi,
I am wondering if anyone can help me out. I have a database that tracts
[quoted text clipped - 28 lines]
 

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