Options

MS Access 2010/2007

excalibur1814excalibur1814 Member Posts: 82 ■■□□□□□□□□
Hello,

I've basically finished the database etc but have hit on one little snag.

User3: IIf([InAnnualElecID]<1,[InAnnualElecCostID]/[Cost_Elec],[InAnnualElecID])

I'm sure that most of you know what the above does, 'but' if the original input field, 'InAnnualElecID' is left blank, nothing actually happens. Zero. If you populate 'InAnnualElecID' with, say 32, -32 or even 0, it functions as requested.

Have I hit the old IsNull thing? Basically, I need to find a way, once the initial Table has been populated, to fill in the missing cells with '0' instead of 'nothing'.

Any help would be appreciated as I do see the light at the end of the tunnel :)

Thanks All
Excalibur
Mooooo

Comments

  • Options
    excalibur1814excalibur1814 Member Posts: 82 ■■□□□□□□□□
    Set a default value
    1.In the Navigation Pane, right-click the table that you want to change, and then click Design View.
    2.Select the field that you want to change.
    3.On the General tab, type a value in the Default Value property box.
    The value you that you can enter depends on the data type that is set for the field. For example, you can type =Date() to insert the current date in a Date/Time field. For examples of default values, see Examples of default values, later in this article.
    Mooooo
  • Options
    excalibur1814excalibur1814 Member Posts: 82 ■■□□□□□□□□
    Solved.

    (snip......) Value='<%# IIf((Request.Form("InAnnualElecID") <> Nothing), Request.Form("InAnnualElecID"), "0") %>' Type="Integer" />

    I added a ZERO instead of "" on the web form. How easy????
    Mooooo
Sign In or Register to comment.