473,943 Members | 16,059 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_DueProject s") 0 Then

DoCmd.RunMacro "TodayProjectsE mail"

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_DueProject s") 0 (and
PrintedNotifica tion is Null) Then

DoCmd.RunMacro "TodayProjectsE mail"

End If

Which Should then only print that Query Once day.
Sep 12 '08 #1
2 2541
The following line should work for you:

If DCount("[ProjectQNo]", "Qry_DueProject s") 0 And
IsNull(Me!Print edNotification) Then

Steve

<da***********@ gmail.comwrote in message
news:51******** *************** ***********@73g 2000hsx.googleg roups.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_DueProject s") 0 Then

DoCmd.RunMacro "TodayProjectsE mail"

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_DueProject s") 0 (and
PrintedNotifica tion is Null) Then

DoCmd.RunMacro "TodayProjectsE mail"

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***********@g mail.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_DueProject s") 0 Then

DoCmd.RunMac ro "TodayProjectsE mail"

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_DueProject s") 0 (and
PrintedNotific ation is Null) Then

DoCmd.RunMac ro "TodayProjectsE mail"

End If

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

Message posted via AccessMonster.c om
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
1535
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 performed at different hospitals and reports based on the queries to print out the relavent details. What I would like to do is have a summary sheet in the Report Footer section that lists a grid of each type of procedure performed as well as the...
1
2845
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 the percentages of each group. The groups are based on sports. For instance, football, soccer, baseball, basketball. I have a table of people that play these sports.
6
3327
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 parameter query which is the recordsource for the report. The parameter is <=. The query returns the correct amounts upto the date entered (no need for "between" dates here). There are 8 textboxes with dcounts; 2 other boxes Sum some of these
15
2991
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 it. Simple database: I want to have a user enter Supply Orders (just for tracking purposes) by Item. The user may also enter a new item - "new" is a combination of Item, PartNumber and Vendor - they could have the
3
3337
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 query I am trying the following: NumOfYes: Dcount(,"qryIndividualFeedbackDetail",=4) The query is counting ALL of the timely manners and is ignoreing my
2
12494
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 works properly with the query until I add a criteria to the query like this:
1
5458
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 SQL, any suggestions would be hugely appreciated. Thanks.
3
2075
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 show how many instances of something happens. Within the query I am using a calculated filed called "registered".The syntax is Registered: DateDiff("w",,)
4
2051
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! frmIncidentSummary!StudentID & " and datediff(""d"",IncidentDateTime,date())=0"). However, there is another field, named IntType, that categorizes the types of incdents. How can this additional criteria, for instance,
0
9970
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11539
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11303
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10666
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8228
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7393
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6312
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3516
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.