"If" statement in report?

Websurfer

New member
Local time
Today, 01:27
Joined
May 6, 2010
Messages
4
Is it possible to write an "If" statement in report?

So based on a article number in a field in the report an extra text would be filled in..?
 
Of course you can use if statements in reports. It would help if you were a bit more specific with your question. :)
 
Hi Websurfer, welcome to the forum,

As suggested a little more information would be very useful to get someone to help you.

As a suggestion always mention which Version of MS Office you are using as it assists in pointing you to the correct area.

An if statement is IIF in Access unless writing in VBA code.

Reply to the thread and someone will take it further.
 
Thanks for trying to give me some help. :o))

I use Access 2003.

I got several questions about this.

The report populates from an sql sentence, that gets an order number from a form, and gets item numbers and item names from a tabel that belongs to that order number.

I tried to alter so it took data from two tabels, ( inner join) but it just does not work.

In the other table, I have columns with boolean value, marked True to what kind of material the item is made of. Copper, Steel, Brass and so on.

The report, shall list of items sorted after the kind of material, and as a footage a special text for that kind of material.

The reports built in grouping possibility does not do the trick, it has only four group levels, (but it might be enough) but the text in the footage repeats several time so I can not use it..?

I also tried in the report, to make an textbox that gets data from a table, but I only gets errors. How do I do this?

I have end up with doing several reports, with a selective sql sentence for each material, and the according text is static.
Then I made a button that prints all reports linked.
I think that solution is not so neat, it's a lot of paper coming out from the printer.

best regards,
Websurfer.
 
Perhaps look at the DLookup Functions.

Also consider stripping down a version of your database and post it here.

Another method might be to create a query and see if you can get it to work in the way you want, and then in the query design view look at the SQL statement which will help comparing it to the current SQL statement.

What is the IF Statement supposed to compare, perhaps break that down like

IIF([Field Name].[tableName]="Yes",

And state what you want it to do at the then side.
 
It does not work for me.
Maybe "DLookup" and "IIF" is not in Access 2003?
 

Users who are viewing this thread

Back
Top Bottom