value based on pull down field

S

SylvieB

Hello All!
i need help with my report.
I have created a form with the following fields: id, title, orderValue,
ContractType
ContractType is a pull down field with 3 choices: FFP, cost plus, ROM.
My question is, on a report how can I accomplish the following (I am using
the same fields than the form, plus a field called ValueForROM)
If contractType is ROM, then the orderValue field is blank and the value is
passed to the ValueForROM field. I don’t know how to start writing the code.
thank you All in advance for any help you can provide.
 
D

Duane Hookom

If I understand correctly, you can use a text box with a control source of:

=IIf(ContractType="ROM",[ValueForROM],[OrderValue])
 
S

SylvieB

Hi Duane,
Thank you very much for your help.
That would work but the problem is the money value from order value is
showing for all records under ValueforRom and ordervalue on the report.
ValueForROM is a field only on the report. Under design view, properties of
the field, it says: "the control has a reference to itself". Any idea how to
fix that?
Thank you

Duane Hookom said:
If I understand correctly, you can use a text box with a control source of:

=IIf(ContractType="ROM",[ValueForROM],[OrderValue])
--
Duane Hookom
Microsoft Access MVP


SylvieB said:
Hello All!
i need help with my report.
I have created a form with the following fields: id, title, orderValue,
ContractType
ContractType is a pull down field with 3 choices: FFP, cost plus, ROM.
My question is, on a report how can I accomplish the following (I am using
the same fields than the form, plus a field called ValueForROM)
If contractType is ROM, then the orderValue field is blank and the value is
passed to the ValueForROM field. I don’t know how to start writing the code.
thank you All in advance for any help you can provide.
 
D

Duane Hookom

I don't know what the fields are in your report's record source. Don't
confusing fields with text box controls.

If you can't figure this out, come back with some sample records from your
report's record source and how you would like them displayed in the report.

--
Duane Hookom
Microsoft Access MVP


SylvieB said:
Hi Duane,
Thank you very much for your help.
That would work but the problem is the money value from order value is
showing for all records under ValueforRom and ordervalue on the report.
ValueForROM is a field only on the report. Under design view, properties of
the field, it says: "the control has a reference to itself". Any idea how to
fix that?
Thank you

Duane Hookom said:
If I understand correctly, you can use a text box with a control source of:

=IIf(ContractType="ROM",[ValueForROM],[OrderValue])
--
Duane Hookom
Microsoft Access MVP


SylvieB said:
Hello All!
i need help with my report.
I have created a form with the following fields: id, title, orderValue,
ContractType
ContractType is a pull down field with 3 choices: FFP, cost plus, ROM.
My question is, on a report how can I accomplish the following (I am using
the same fields than the form, plus a field called ValueForROM)
If contractType is ROM, then the orderValue field is blank and the value is
passed to the ValueForROM field. I don’t know how to start writing the code.
thank you All in advance for any help you can provide.
 
S

SylvieB

hey Duane
You're right I confused the term. On the report, valueForROM is a text box.
the code does not work totally. If on the form, under ContractType I select
the value ROM, on the report it shows #Error for ValueforRom, and if I select
other value than ROM on the form, on the report it shows the same $$ amount
for Order Value and Value for ROM, meaning it does not filter it. Sorry to be
a pain. I'm still learning Access 2007. Thanks

Duane Hookom said:
I don't know what the fields are in your report's record source. Don't
confusing fields with text box controls.

If you can't figure this out, come back with some sample records from your
report's record source and how you would like them displayed in the report.

--
Duane Hookom
Microsoft Access MVP


SylvieB said:
Hi Duane,
Thank you very much for your help.
That would work but the problem is the money value from order value is
showing for all records under ValueforRom and ordervalue on the report.
ValueForROM is a field only on the report. Under design view, properties of
the field, it says: "the control has a reference to itself". Any idea how to
fix that?
Thank you

Duane Hookom said:
If I understand correctly, you can use a text box with a control source of:

=IIf(ContractType="ROM",[ValueForROM],[OrderValue])
--
Duane Hookom
Microsoft Access MVP


:

Hello All!
i need help with my report.
I have created a form with the following fields: id, title, orderValue,
ContractType
ContractType is a pull down field with 3 choices: FFP, cost plus, ROM.
My question is, on a report how can I accomplish the following (I am using
the same fields than the form, plus a field called ValueForROM)
If contractType is ROM, then the orderValue field is blank and the value is
passed to the ValueForROM field. I don’t know how to start writing the code.
thank you All in advance for any help you can provide.
 
D

Duane Hookom

A report is based on a table or query (records) not a form. I don't think it
matters what is on your form when I am more concerned about what is stored in
your table. That's why I suggested:
"come back with some sample records from your report's record source and how
you would like them displayed in the report"

You are telling me about a form and I want to know about your values in your
table/query and then how you expect them to be displayed.


--
Duane Hookom
Microsoft Access MVP


SylvieB said:
hey Duane
You're right I confused the term. On the report, valueForROM is a text box.
the code does not work totally. If on the form, under ContractType I select
the value ROM, on the report it shows #Error for ValueforRom, and if I select
other value than ROM on the form, on the report it shows the same $$ amount
for Order Value and Value for ROM, meaning it does not filter it. Sorry to be
a pain. I'm still learning Access 2007. Thanks

Duane Hookom said:
I don't know what the fields are in your report's record source. Don't
confusing fields with text box controls.

If you can't figure this out, come back with some sample records from your
report's record source and how you would like them displayed in the report.

--
Duane Hookom
Microsoft Access MVP


SylvieB said:
Hi Duane,
Thank you very much for your help.
That would work but the problem is the money value from order value is
showing for all records under ValueforRom and ordervalue on the report.
ValueForROM is a field only on the report. Under design view, properties of
the field, it says: "the control has a reference to itself". Any idea how to
fix that?
Thank you

:

If I understand correctly, you can use a text box with a control source of:

=IIf(ContractType="ROM",[ValueForROM],[OrderValue])
--
Duane Hookom
Microsoft Access MVP


:

Hello All!
i need help with my report.
I have created a form with the following fields: id, title, orderValue,
ContractType
ContractType is a pull down field with 3 choices: FFP, cost plus, ROM.
My question is, on a report how can I accomplish the following (I am using
the same fields than the form, plus a field called ValueForROM)
If contractType is ROM, then the orderValue field is blank and the value is
passed to the ValueForROM field. I don’t know how to start writing the code.
thank you All in advance for any help you can provide.
 

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