Re: Calculating dates..
- From: "Joel" <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 21 Jul 2005 07:23:01 -0700
I tried making another form with the query as the record source and I set a
textbox to Expr1 and I just get a blank box. (I have the other form open so
the query can read the combobox that feeds the criteria)
"Allen Browne" wrote:
> You cannot make a new query based on that table, and put the calculated
> field in that query so you can refer to it in your form as well as all the
> other fields you already have?
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Joel" <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:FBB49B1F-570F-4610-A4A1-F6C13FCF6A0E@xxxxxxxxxxxxxxxx
> >I cant change the record source of the form, I need it set to the table it
> > set to.
> >
> > "Allen Browne" wrote:
> >
> >> You need to put that into the query that feeds the form. You can then
> >> just
> >> set the Control Source of the text box to the name of the calculated
> >> field
> >> (Expr1 in your example.)
> >>
> >> It is possible to DLookup() the result from a query, but that seems
> >> pointless when you could include the calculated field in the form's
> >> RecordSource.
> >>
> >> "Joel" <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> news:0D437B88-130E-4222-99C9-7D53D9B8C890@xxxxxxxxxxxxxxxx
> >> > Thank you for your responce.
> >> > But Im still having trouble with this. I got the query to work just
> >> > fine
> >> > but
> >> > I cant get the calculated date to show up in a text box on the form or
> >> > a
> >> > report, all I get is #Name?.
> >> > I have the control of that textbox [Text147] set to
> >> > =InspectionFrequencyQuery!Expr1
> >> > Also I have the combobox [InspectionFrequency] set to do a
> >> > requery(Me!Text147.ReQuery) after update.
> >> >
> >> > Thanks
> >> >
> >> > "Allen Browne" wrote:
> >> >
> >> >> Use DateAdd() to add the number of months or years.
> >> >>
> >> >> Joel, you probably have a table for the InspectionFrequency dates.
> >> >> How about adding 2 more fields to the table:
> >> >> PeriodType
> >> >> Freqency
> >> >> The PeriodType will contain the text DateAdd needs, e.g. "m", "yyyy",
> >> >> "d",
> >> >> "q".
> >> >> The Frequency is the number of periods.
> >> >> Example data:
> >> >> 3 months m 3
> >> >> 6 monhts m 6
> >> >> 1 year yyyy 1
> >> >> 5 years yyyy 5
> >> >>
> >> >> Now you can make a query that contains both tables, and create a
> >> >> calculated
> >> >> field by typing this into a fresh column in the Field row:
> >> >> DateAdd([PeriodType], [Frequency], [InspectionDate])
> >> >>
> >> >> "Joel" <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> >> news:1AE960E2-7BF3-458A-BE5C-8D228AEFFDBF@xxxxxxxxxxxxxxxx
> >> >> >I need to have a textbox display a calculated date from another field
> >> >> >in
> >> >> >my
> >> >> > report.
> >> >> >
> >> >> > ex: User types in the date [InspectionDate] on the form, then they
> >> >> > select
> >> >> > the inspection frequency ([InspectionFrequency] values are 3 months,
> >> >> > 6m,
> >> >> > 1y,2y,3y,4y,5y, and 10y and each has a unique id).
> >> >> >
> >> >> > Now in my report i need the [InspectionDate] to add the
> >> >> > [InspectionFrequency] and display in the report.
> >> >> >
> >> >> > Thanks.
>
>
>
.
- Follow-Ups:
- Re: Calculating dates..
- From: Allen Browne
- Re: Calculating dates..
- References:
- Calculating dates..
- From: Joel
- Re: Calculating dates..
- From: Allen Browne
- Re: Calculating dates..
- From: Joel
- Re: Calculating dates..
- From: Allen Browne
- Re: Calculating dates..
- From: Joel
- Re: Calculating dates..
- From: Allen Browne
- Calculating dates..
- Prev by Date: Re: Calculating dates..
- Next by Date: Re: Calculating dates..
- Previous by thread: Re: Calculating dates..
- Next by thread: Re: Calculating dates..
- Index(es):
Relevant Pages
|