you're welcome, Kevin -- glad you got it ~ crystal
On 1/20/2019 1:00 AM, qingqinga@yahoo.com [MS_Access_Professionals] wrote:
> Dear Crystal,
> Thanks a lot for your help. The problem is solved, I received your message right after my reply to Duane, Here's my solution:
>
> I found out that the query is correct, it just that the unbound text box didn't pass the value to the query. I add a requery on the form load event to pass the value. It works perfect now. Thanks again.
>
>
> Best Regards,
> Kevin
>
> --------------------------------------------
> On Sun, 1/20/19, crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
>
> Subject: Re: [MS_AccessPros] DatePart Criteria doesn't work.
> To: MS_Access_Professionals@yahoogroups.com
> Date: Sunday, January 20, 2019, 2:54 PM
>
>
> hi Kevin,
>
>
>
> another thing you can try is setting the data type to be
> Integer for
> [Forms]![frmOfficeLocationProfit]![MonthCalc]
> in the query Parameters
>
> or perhaps surround NZ with CInt to convert to
> integer
> ~crystal
>
>
>
> On 1/19/2019
> 11:14 PM, Duane Hookom
> duanehookom@hotmail.com
> [MS_Access_Professionals] wrote:
>
>
>
>
>
>
>
>
> Kevin,
>
>
>
>
>
> What happens if you open the debug window (press
> Ctrl+G) and
> enter:
>
> ?
>
> DSum("AmountFinal","qryManagerialCostCalc","ActualMonth=1")
>
>
>
> What is the SQL view of
> qryManagerialCostCalc?
>
>
> What do you see if you create a new blank
> query and enter this SQL:
>
>
> SELECT Sum(AmountFinal) as TotalFinalIn
> FROM qry ManagerialCostCalc WHERE ActualMonth =
> 1;
>
>
>
>
>
> Regards,
>
> Duane
>
>
>
>
>
>
> From:�
> Qingqing qingqinga@yahoo.com
> Sent:
> Saturday, January 19, 2019 11:02 PM
>
>
> �
>
>
> Dear All,
>
> I tried to use DatePart('m',MyDate)
> to get the month,in
> a query, it worked fine. But when I apply
> the month as
> criteria in a form, it didn't work.
> after running the
> query, the result is bland, containing no
> record. Here's
> what I have in a form query:
>
>
>
> TotalFinalIn:
>
> DSum("AmountFinal","qryManagerialCostCalc","ActualMonth="
> &
>
> Nz([Forms]![frmOfficeLocationProfit]![MonthCalc],0))
>
>
>
> The MonthCalc in the form is unbound text
> box. and on
> the form load event I use:
> Me.MonthCalc=Month(Date), I
> want to calculate the total managerial cost
> in the
> current month.
>
>
>
> Please help.
>
> Best Regards,
>
> Kevin
>
>
>
>
> ------------------------------------
> Posted by: <zhao.liqing@yahoo.com>
> ------------------------------------
>
>
> ------------------------------------
>
> Yahoo Groups Links
>
>
>
Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (6) |
Tidak ada komentar:
Posting Komentar