NEED HELP!!!!!

sean_churchill

New Member
Joined
Feb 20, 2003
Messages
11
Hi

i trying to produce a formula in 'Form' by the following expression:-

If (this_date) < (today's_date) by 6 months then
mgs = "This file needs updating!!"

not sure how to do this!

I got over a thousand records and i need to check each one to see whether it meets this expression? This has to be displayed by a Warning box.

If you can help that would be great. just a beginner!!!!

Thanks.

Sean.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
You can create a query that will extract the information you want. Then you can link your form to the query. So every record in the form will fall under the criteria in the query.
 
Upvote 0
Ok, how about this?

Use a Query (as suggested), defined as something like this:

SELECT Table1.*
FROM Table1
WHERE (((Table1.PurchaseDate)>DateAdd("m",-6,Now())));


Paste that in Query builder (in SQL view of course) and change the "Table1" to the table name and "PurchaseDate" to the name of your date column, and it will show you all records greater than 6 months old.

Then you will have all the records you need, to change in query view, report, or change via a form based on the query.
 
Upvote 0
I am not sure what you mean by "it needs to be done automatically". What needs to be done automatically???

The query I gave you will show you all the records in question. If there are any, then you have a problem that needs to be fixed.

What you do to fix them, I have no idea, but here you will know if you have something or not.

One last attempt to help, based on what I understand so far.

If you create the query I gave you earlier, and name it "qryDateCheck" then on your form create a button, with the following code for the Click event, you will get your error message.

Dim lngCnt As Long

lngCnt = DCount("*", "qryDateCheck")
If lngCnt > 0 Then
MsgBox lngCnt & " Records with bad dates"
End If
 
Upvote 0

Forum statistics

Threads
1,221,497
Messages
6,160,152
Members
451,625
Latest member
sukhman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top