IsNull Criteria (1 Viewer)

D

DLMitch

Guest
I import information to a table. I have a query that I want to have it put $100.00 whenever the price field blank. Is there a way to put IsNull or IsEmpty=$100.00 into the criteria of the query, so that it can perform a calculation.
Thanks
 

edtab

Registered User.
Local time
Today, 07:58
Joined
Mar 30, 2002
Messages
257
You need to create an "update query" which you should run after you have imported your data.

Build a query using the table you are importing into as the source.

In the query grid, drag the "price" field from your table into one of the columns.

Right click on the blank part of your query grid (above the rows and to the right of your table); this will open a pop up form that will allow you to select what type of query you are trying to create.

Mouse over the "Query type", this will slide out another choice list where you should click "Update query".

After you do this, a row will be inserted in your grid saying "Update to".

Enter 100 on the cell formed by your column and the "Update to" row.

Now go to the criteria row and type in
Is null.

Save your query giving it a name.

On your main form, create a command button.
On this button's "On Click" property, create the following code:

DoCmd.OpenQuery "Substitue Your query name here"

Save the main form.

To test, call your main form and click on the command button you just created. This should run your query and place $100 on all price fields containing "null" values.

Hope this works for you.
 

Users who are viewing this thread

Top Bottom