By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,651 Members | 1,757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,651 IT Pros & Developers. It's quick & easy.

DCount Query Via Form

P: n/a
Need Some Help,

In Modifing this Bit of VBA Code,

This the code i use and it works but i want it to go one step further
in on the open event of my main start up form

If DCount("[ProjectQNo]", "Qry_DueProjects") 0 Then

DoCmd.RunMacro "TodayProjectsEmail"

End If

in that Macro i also have a action which updates a Field PrintedDate
in the Qry_DueProjects and puts todays date in.

What i Want to happen is

If DCount("[ProjectQNo]", "Qry_DueProjects") 0 (and
PrintedNotification is Null) Then

DoCmd.RunMacro "TodayProjectsEmail"

End If

Which Should then only print that Query Once day.
Sep 12 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The following line should work for you:

If DCount("[ProjectQNo]", "Qry_DueProjects") 0 And
IsNull(Me!PrintedNotification) Then

Steve

<da***********@gmail.comwrote in message
news:51**********************************@73g2000h sx.googlegroups.com...
Need Some Help,

In Modifing this Bit of VBA Code,

This the code i use and it works but i want it to go one step further
in on the open event of my main start up form

If DCount("[ProjectQNo]", "Qry_DueProjects") 0 Then

DoCmd.RunMacro "TodayProjectsEmail"

End If

in that Macro i also have a action which updates a Field PrintedDate
in the Qry_DueProjects and puts todays date in.

What i Want to happen is

If DCount("[ProjectQNo]", "Qry_DueProjects") 0 (and
PrintedNotification is Null) Then

DoCmd.RunMacro "TodayProjectsEmail"

End If

Which Should then only print that Query Once day.

Sep 13 '08 #2

P: n/a
Is there a need to use the comparison operator in the Dcount? I don't see why
">0" it would help you to evaluate Dcount.

DCount without the operator in the IfThen statement will always evaluate True
or False. Any value of 1 and above will always be True and 0 will be False.

da***********@gmail.com wrote:
>Need Some Help,

In Modifing this Bit of VBA Code,

This the code i use and it works but i want it to go one step further
in on the open event of my main start up form

If DCount("[ProjectQNo]", "Qry_DueProjects") 0 Then

DoCmd.RunMacro "TodayProjectsEmail"

End If

in that Macro i also have a action which updates a Field PrintedDate
in the Qry_DueProjects and puts todays date in.

What i Want to happen is

If DCount("[ProjectQNo]", "Qry_DueProjects") 0 (and
PrintedNotification is Null) Then

DoCmd.RunMacro "TodayProjectsEmail"

End If

Which Should then only print that Query Once day.
--
Please Rate the posting if helps you

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200809/1

Sep 16 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.