If statement in my report please help :)

lfctez

New member
Local time
Today, 20:36
Joined
Apr 30, 2013
Messages
4
Hi everyone.

I was looking for a little bit of help if possible. This is all in a report by the way, the data comes from a query which comes from a table :)

Basically, I have a combo box, and a text box.

The combo box can have either one of three different values, DFB, QB8 or Hillside and it is called CustomerOrderNo.

The text box next to this contains its goods value, this text box is called Value1.

I would like three more text boxes next to these called txtDFB, txtQB8 and txtHillside.

Now I got these, I would like these boxes to display the goods value from the corresponding CustomerOrderNo.

For example, if the CustomerOrderNo is DFB and the value is 100.00, then the value will still appear in the Value1 text box and also the txtDFB text box. With the other two text boxes showing 0.00.

Is this done with a If statement or is there an easier way?

Any help is gratefully appreciated :)
 
Hi everyone.

I was looking for a little bit of help if possible. This is all in a report by the way, the data comes from a query which comes from a table :)

Basically, I have a combo box, and a text box.

The combo box can have either one of three different values, DFB, QB8 or Hillside and it is called CustomerOrderNo.

The text box next to this contains its goods value, this text box is called Value1.

I would like three more text boxes next to these called txtDFB, txtQB8 and txtHillside.

Now I got these, I would like these boxes to display the goods value from the corresponding CustomerOrderNo.

For example, if the CustomerOrderNo is DFB and the value is 100.00, then the value will still appear in the Value1 text box and also the txtDFB text box. With the other two text boxes showing 0.00.

Is this done with a If statement or is there an easier way?

Any help is gratefully appreciated :)

I sense a design issue here, but I will first describe a possible solution, and then explain my concerns.

What you want to do can be done by using VB Code in the "On Change" Event for the CustomerOrderNo Dropdown by first setting all three values to 0, and then setting the one related to the selection to the proper value.

My main concern is that this is designed for EXACTLY three choices. What will happen when there are going go be additional choices, or perhaps even when one of the choices is eliminated or needs to change? Will there be a need to allow for things of that nature?

-- Rookie
 
Hi and thanks for the reply :)

When I go to the properties of my dropdown, there is no 'on change'. Is this because it is in a report and not a form?

And yes, the choices will stay the same and not be changed. With no additional choices being added.

I am not a huge fan of access or doing database altogether to be honest.
But with what I know, is it something like:

If CustomerOrderNo = DFB then
txtDFB = Value1

Or

If CustomerOrderNo = DFB then
Me.txtDFB.Value = Me.CustomerOrderNo.Column (7)

Value is the 8th column in my query.

Something like that on the report properties, 'on load'?

Like I said, I don't really know much so I'm guessing here :P
 

Users who are viewing this thread

Back
Top Bottom