473,320 Members | 1,982 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,320 software developers and data experts.

Dcount

Hi
I am using the following 'On Load'
It is working correctly to show me MOT's that are due and after it has found
the MOTs due it then shows me what TAX is due (from the similar code as below
attached to the On close MOT report). All working fine UNTIL there is NO MOT
due it returns to the switchboard.
How do I write the code. IF the MOT is 0 then check the Status of the TAX.

Hope this makes some sense.
MAX

Private Sub Form_Load()

Dim intStore As Integer
intStore = DCount("[id]", "[vEHICLE DETAILS]", "[MOT DUE] <=Now()")

If intStore = 0 Then

Else
If MsgBox("There are " & intStore & " uncompleted jobs" &
_
vbCrLf & vbCrLf & "Would you like to see these now?", _
vbYesNo, "You Have Uncomplete MOT...") = vbYes Then
DoCmd.Minimize
DoCmd.OpenReport "REPORT Reminders mot", acPreview
Else

End If
End If

End Sub
May 22 '06 #1
1 1789
Jan
Hi:

If it were me I'd create a recordset and work from there.

air code.....
dim db as database
dim rs as dao.recordset
set db=currentdb()
set rs=db.openrecordset("select * from [vehicle details] where [there is
an mot due] and [mot due]<=now()")
rs.movelast
rs.movefirst
if rs.recordcount>0 then
...code for having incomplete jobs
else
...code for having no incomplete jobs
endif

rs.close
set rs=nothing
set db=nothing

HTH

Jan

maxjake wrote:
Hi
I am using the following 'On Load'
It is working correctly to show me MOT's that are due and after it has found
the MOTs due it then shows me what TAX is due (from the similar code as below
attached to the On close MOT report). All working fine UNTIL there is NO MOT
due it returns to the switchboard.
How do I write the code. IF the MOT is 0 then check the Status of the TAX.

Hope this makes some sense.
MAX

Private Sub Form_Load()

Dim intStore As Integer
intStore = DCount("[id]", "[vEHICLE DETAILS]", "[MOT DUE] <=Now()")

If intStore = 0 Then

Else
If MsgBox("There are " & intStore & " uncompleted jobs" &
_
vbCrLf & vbCrLf & "Would you like to see these now?", _
vbYesNo, "You Have Uncomplete MOT...") = vbYes Then
DoCmd.Minimize
DoCmd.OpenReport "REPORT Reminders mot", acPreview
Else

End If
End If

End Sub

May 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: jdph40 | last post by:
I posted this problem previously and received excellent help from Wayne Morgan. However, I still have an unanswered question. My form (frmVacationWeeks) is opened from the OnClick event of a...
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...
4
by: Will | last post by:
Hi, I had a DCount within a module on records in a table where CustSuffix = 0. I now need to DCount where CustSuffix = 0 and the type of cost Suffix (Suffix in table) = G. I can't get both...
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...
2
by: Paul T. RONG | last post by:
Hi, I have a problem with DCount, the following code doesn't work: DCount("", "qryOrder", "( = Me! AND = 'drink')" > 0 Please help. Thank you.
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: Kaspa | last post by:
Hello I am trying to create dcount field but is not working I have tried every way possible and I can't get it to work. here is my code: =Dcount("","qryTotalscratched"," in (6,7,8,9) and ...
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...
2
by: Wingz | last post by:
Hiya, Fairly new to Access and was wondering what the best way to perform Dcounts on groups in an Access report. For example, I have 10 employees and the different instances of jobs they can...
8
by: Susan Bricker | last post by:
I have used DCount() to determine the number of records in a recordset. Silly me ... I just noticed that DCount returns an INTEGER, which can hold a maximum value of 32,767. What if the recordset...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.