Access vba

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

karlhaywood

Thread Starter
Account Closed
Joined
Jan 17, 2010
Messages
680
Hi,

i need some help with vba. i have created a query to check whether a job as gone past its "expected completion date" That works fine and it give me the correct results. I need some vba to check through the table and give me a message box of how many jobs have gone past the finish date.

Thanks.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
You just need a Recordset based on your Query with the message
msgbox "There are " & rs.recordcount & " jobs past their completion dates"
where rs is the recordset.
 

karlhaywood

Thread Starter
Account Closed
Joined
Jan 17, 2010
Messages
680
I have actually got some code that used the DLOOKUP, but i cant get it to work. Take a look at the attached file.
 

Attachments

OBP

Joined
Mar 8, 2005
Messages
19,895
It is much easier with the query, because you can run it and check the number of records, plus it will probably be used for your form to display the records anyway.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
What does it do?
There is a line missing, after the Else there should be
intStore = rs.recordcount

But that isn't actually using your query.
 

karlhaywood

Thread Starter
Account Closed
Joined
Jan 17, 2010
Messages
680
On Load it should look throught the database check for jobs past the expected completion date give me a message boxwith the count of jobs and then open the reminders form.
 

karlhaywood

Thread Starter
Account Closed
Joined
Jan 17, 2010
Messages
680
i would do but the database is on my external hard drive and im in Wales lol i will do as soon as i get back.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top