Is this possible with a textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a text box that is currently set up so that it has a control source of
a query and takes the value of a cell in a table.
What I would like to happen is that if the qry does not find a value then
the text box is assigned the value -1, if it does find the value however I
would like it to take on that value.
Thanks
-Steve
 
I presume you mean a control source of a field in a query?

You can use IIf in the query so in place of MyField in the Field row put
something like:
Expr1: IIf(IsNull([MyField]),-1,[MyField]) and make Expr1 the control source
of your text box

Look up IIF in help to see how it works

HTH
 
Thanks Jon
I found some information on the Nz Function and ended up using that.
Thanks again.

Jon Lewis said:
I presume you mean a control source of a field in a query?

You can use IIf in the query so in place of MyField in the Field row put
something like:
Expr1: IIf(IsNull([MyField]),-1,[MyField]) and make Expr1 the control source
of your text box

Look up IIF in help to see how it works

HTH


steveatdb said:
I have a text box that is currently set up so that it has a control source
of
a query and takes the value of a cell in a table.
What I would like to happen is that if the qry does not find a value then
the text box is assigned the value -1, if it does find the value however I
would like it to take on that value.
Thanks
-Steve
 

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

Back
Top