473,386 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DCount Query Via Form

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
2 2508
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Simon Matthews | last post by:
Hope someone can help an Access beginner! I've just started keeping my surgical logbook on access and it's a simple flat-file affair. I have created several queries that will list cases...
1
by: Megan | last post by:
Hi Everybody- I've been reading some of the posts about DCOUNT, and I haven't yet found an answer; so, I'm posting this question. I have a report that I'm trying to use DCOUNT on to compute...
6
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a...
15
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting...
3
by: BerkshireGuy | last post by:
I am having difficulty with using the Dcount function. I am trying to return the number of records from qryIndividualFeedbackDetail where the TimelyManner field is set to 4. So, in the new...
2
by: ChasW | last post by:
Greetings, I have a form that uses a query as its record source. In the form I have a text box that uses this as its control source: =DCount("", "qry_Search_by_Name") The DCount function...
1
by: Sheldon Mopes | last post by:
I have read a few articles that state that a multi-user app over a network will run faster if DSum & DCount functions are replaced with SQL statements replicating the functions. As I am a novice to...
3
by: davidwelli | last post by:
Hello, All help is appreciated, I'm struggling with the following. Using Access 2003 (front end) connecting to Oracle 7 database (back end). I'm trying to create a query in access that will...
4
by: 6afraidbecause789 | last post by:
I was able to glean syntax online for a DCount on a form that counts the number of 'misbehavior' incidents for students for the current day: =DCount("StudentID","Incidents","StudentID=" & Forms!...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.