Kamis, 22 September 2011

[MS_AccessPros] Re: Update calculated fields when form, opens

 

Nige -

You should be able to do that in your query using an implicit IIf statement, but you will have to test it.

WarrantyDaysLeft: IIf(IsNull([PartNumber]), Null, ExpressionGoesHere)

Bill

--- In MS_Access_Professionals@yahoogroups.com, "nigelhjackson" <nigel@...> wrote:
>
> OK, thanks, that works fine!
>
> Just one more question for now. When I add a new record, and before entering the data, the field now shows a zero. How can I add a condition so that if the PartNumber field is blank the WarrantyDaysLeft field is also blank?
>
> Cheers Bill!
>
>
>
> --- In MS_Access_Professionals@yahoogroups.com, "Bill Mosca" <wrmosca@> wrote:
> >
> > Nige
> >
> > It is not wise to store calculated values. All you really need to do is put the expression in your form's query. You can also do that in any reports you might have that show the number of days.
> >
> > Regards,
> > Bill Mosca, Founder - MS_Access_Professionals
> > http://www.thatlldoit.com
> > Microsoft Office Access MVP
> > https://mvp.support.microsoft.com/profile/Bill.Mosca
> >
> >
> >
> > --- In MS_Access_Professionals@yahoogroups.com, "nigelhjackson" <nigel@> wrote:
> > >
> > > In this warranty database I'm cobbling together I have a field for Warranty Days Left. When a record is added that field is calculated on an AfterUpdate event of another field using WarrantyExpiryDate-Date.
> > >
> > > Obviously all the expiry days left need to update each day, when a user opens the form, and the new values (normally 1 day less!) stored in the table to replace the existing.
> > >
> > > BUT...I don't know how to do this!
> > >
> > > Can someone please help with a description of how to do this update when the form loads, and/or some code. I'd rather do the update automatically, but if I have to put code behind an 'Update' button that'll be fine.
> > >
> > > Thanks, Nige
> > >
> >
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar