Return an alert box somehow.

G

geeves1293

Hi all,

My head cannot take it anymore. I need help please!!!!

I need to return some sort of alert to the user that a date has passed.

i.e. User! Don't you know that sales order is now a week old!!!

I have a table which has numerous fields, one of which is a date (Order
dates). I need something that on Startup, pops up with above alert or alerts
depending on how many are too old.

Would be over the moon for any help.

Regards

Geeves1293
 
J

Jae

In FormLoad put this code in:

****************
Dim i As Integer
Dim d As Date

d = Date - 7 'for the order that's older than 7 days

i = DCount("department", "LOG", "[Date Received] < #" & d & "#")

If i > 0 Then
MsgBox " You have " & i & " orders that are older than " & d
End If
****************
Let me know whether it works or not.
 
J

Jae

In FormLoad put this code in:

****************
Dim i As Integer
Dim d As Date

d = Date - 7 'for the order that's older than 7 days

i = DCount("FieldName", "TableName", "[OrderDate] < #" & d & "#")

If i > 0 Then
MsgBox " You have " & i & " orders that are older than " & d
End If
****************
Let me know whether it works or not.
 
L

Lars Brownie

You can consider a calculated field on the main form which shows how many
sales are overdue.
Assuming you have a field Date_invoice and a field Date_sales_ready you can
do the following for example:

- Create an unbound text object on your Salesform and call it fldOverdue
- Put the following code in it (adjust to the names you use):
=DCount("ID_sales";"tblSales";"Date_sales_ready is null AND [Date_sales]
<date() - 7")
- In the Date_sales_ready's afterupdate event put:
fldOverdue.Requery

The fldOverdue will show the number of sales where the Date_sales_ready
field is empty and where the Date_sales is older than 7 days. With
conditional layout you can turn the fldOverdue's value turn red and bold
when the value is bigger than 0. When the user enters the Date_sales_ready
in the form, the fldOverdue is refreshed.

Extra:
If all is working you also make a multicolumn combobox where the record
source is a query that does the same calculation. When you click the combo
the overdue records will drop down. In the combo's afterupdate you can put
code so that when the user chooses an overdue sales, the chosen sales record
is located on the basis of the ID_sales value.

Lars
 
G

geeves1293

Thanks Jae, sorry for sounding silly, but where do I find FormLoad, never
heard of that one before.

Geeves1293

Jae said:
In FormLoad put this code in:

****************
Dim i As Integer
Dim d As Date

d = Date - 7 'for the order that's older than 7 days

i = DCount("FieldName", "TableName", "[OrderDate] < #" & d & "#")

If i > 0 Then
MsgBox " You have " & i & " orders that are older than " & d
End If
****************
Let me know whether it works or not.


geeves1293 said:
Hi all,

My head cannot take it anymore. I need help please!!!!

I need to return some sort of alert to the user that a date has passed.

i.e. User! Don't you know that sales order is now a week old!!!

I have a table which has numerous fields, one of which is a date (Order
dates). I need something that on Startup, pops up with above alert or alerts
depending on how many are too old.

Would be over the moon for any help.

Regards

Geeves1293
 
J

Jae

Sorry about that. it's an event "On Load" in form property.

geeves1293 said:
Thanks Jae, sorry for sounding silly, but where do I find FormLoad, never
heard of that one before.

Geeves1293

Jae said:
In FormLoad put this code in:

****************
Dim i As Integer
Dim d As Date

d = Date - 7 'for the order that's older than 7 days

i = DCount("FieldName", "TableName", "[OrderDate] < #" & d & "#")

If i > 0 Then
MsgBox " You have " & i & " orders that are older than " & d
End If
****************
Let me know whether it works or not.


geeves1293 said:
Hi all,

My head cannot take it anymore. I need help please!!!!

I need to return some sort of alert to the user that a date has passed.

i.e. User! Don't you know that sales order is now a week old!!!

I have a table which has numerous fields, one of which is a date (Order
dates). I need something that on Startup, pops up with above alert or alerts
depending on how many are too old.

Would be over the moon for any help.

Regards

Geeves1293
 
G

geeves1293

All going swimmingly until I run it. It wants to know where the table/query
LOG is.

Is the 'LOG' my table name where the date field exists?

Sorry for all the questions and thanks for your patience.

Geeves 1293

Jae said:
Sorry about that. it's an event "On Load" in form property.

geeves1293 said:
Thanks Jae, sorry for sounding silly, but where do I find FormLoad, never
heard of that one before.

Geeves1293

Jae said:
In FormLoad put this code in:

****************
Dim i As Integer
Dim d As Date

d = Date - 7 'for the order that's older than 7 days

i = DCount("FieldName", "TableName", "[OrderDate] < #" & d & "#")

If i > 0 Then
MsgBox " You have " & i & " orders that are older than " & d
End If
****************
Let me know whether it works or not.


:

Hi all,

My head cannot take it anymore. I need help please!!!!

I need to return some sort of alert to the user that a date has passed.

i.e. User! Don't you know that sales order is now a week old!!!

I have a table which has numerous fields, one of which is a date (Order
dates). I need something that on Startup, pops up with above alert or alerts
depending on how many are too old.

Would be over the moon for any help.

Regards

Geeves1293
 
J

Jae

Sorry about the confusion. Please see my corrected one. I forgot to change
the name of fields and tables in my first post. But, to answer your question,
yes 'LOG' is the table name. I was just testing the code in one of the access
table.

geeves1293 said:
All going swimmingly until I run it. It wants to know where the table/query
LOG is.

Is the 'LOG' my table name where the date field exists?

Sorry for all the questions and thanks for your patience.

Geeves 1293

Jae said:
Sorry about that. it's an event "On Load" in form property.

geeves1293 said:
Thanks Jae, sorry for sounding silly, but where do I find FormLoad, never
heard of that one before.

Geeves1293

:

In FormLoad put this code in:

****************
Dim i As Integer
Dim d As Date

d = Date - 7 'for the order that's older than 7 days

i = DCount("FieldName", "TableName", "[OrderDate] < #" & d & "#")

If i > 0 Then
MsgBox " You have " & i & " orders that are older than " & d
End If
****************
Let me know whether it works or not.


:

Hi all,

My head cannot take it anymore. I need help please!!!!

I need to return some sort of alert to the user that a date has passed.

i.e. User! Don't you know that sales order is now a week old!!!

I have a table which has numerous fields, one of which is a date (Order
dates). I need something that on Startup, pops up with above alert or alerts
depending on how many are too old.

Would be over the moon for any help.

Regards

Geeves1293
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top