A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

event help



 
 
Thread Tools Display Modes
  #1  
Old December 19th, 2008, 10:53 AM posted to microsoft.public.access.tablesdbdesign
Tom
external usenet poster
 
Posts: 1,359
Default event help

I am in access 2007 and I have a table called inventory with the following
fields included:
I have a field called [restock level] and it is numeric
a field called [current purchases] which is numeric
and a field called [current inventory level] which is numeric

I created a query and included a calculated field called todays inventory
which subtracts [current purchases] from the [current inventory level]

I created a report based on the inventory query . it could just as easily be
a form



In that report I would like a message to display if the number in [todays
inventory] is less than or equal to the [restock level]

i created a warning label saying that reorder immmediately
I named the label restockmsg

I made some simple code and tried to attach it to the todays inventory field

If [todays inventory] = [restock level] Then
[restockmsg].Visible = True
[restock level].ForeColor = 255
Else
[restockmsg].Visible = False
[restock level].ForeColor = 0
End Sub

I would like to attach it to the after update field but there is no after
update field in the events . I am not sure wheer I have gone wrong.

Any suggestions would be appreciated
Thanks
Tom

  #2  
Old December 19th, 2008, 03:56 PM posted to microsoft.public.access.tablesdbdesign
Clifford Bass[_2_]
external usenet poster
 
Posts: 1,295
Default event help

Hi Tom,

Put it in the Detail section's On Format event. You may also want to
check out the conditional formatting option (Report Design Tools, Design
ribbon, Font section).

Clifford Bass

"Tom" wrote:

I am in access 2007 and I have a table called inventory with the following
fields included:
I have a field called [restock level] and it is numeric
a field called [current purchases] which is numeric
and a field called [current inventory level] which is numeric

I created a query and included a calculated field called todays inventory
which subtracts [current purchases] from the [current inventory level]

I created a report based on the inventory query . it could just as easily be
a form



In that report I would like a message to display if the number in [todays
inventory] is less than or equal to the [restock level]

i created a warning label saying that reorder immmediately
I named the label restockmsg

I made some simple code and tried to attach it to the todays inventory field

If [todays inventory] = [restock level] Then
[restockmsg].Visible = True
[restock level].ForeColor = 255
Else
[restockmsg].Visible = False
[restock level].ForeColor = 0
End Sub

I would like to attach it to the after update field but there is no after
update field in the events . I am not sure wheer I have gone wrong.

Any suggestions would be appreciated
Thanks
Tom

  #3  
Old December 19th, 2008, 04:30 PM posted to microsoft.public.access.tablesdbdesign
Tom
external usenet poster
 
Posts: 1,359
Default event help


I'll give that a try
Thanks
"Clifford Bass" wrote:

Hi Tom,

Put it in the Detail section's On Format event. You may also want to
check out the conditional formatting option (Report Design Tools, Design
ribbon, Font section).

Clifford Bass

"Tom" wrote:

I am in access 2007 and I have a table called inventory with the following
fields included:
I have a field called [restock level] and it is numeric
a field called [current purchases] which is numeric
and a field called [current inventory level] which is numeric

I created a query and included a calculated field called todays inventory
which subtracts [current purchases] from the [current inventory level]

I created a report based on the inventory query . it could just as easily be
a form



In that report I would like a message to display if the number in [todays
inventory] is less than or equal to the [restock level]

i created a warning label saying that reorder immmediately
I named the label restockmsg

I made some simple code and tried to attach it to the todays inventory field

If [todays inventory] = [restock level] Then
[restockmsg].Visible = True
[restock level].ForeColor = 255
Else
[restockmsg].Visible = False
[restock level].ForeColor = 0
End Sub

I would like to attach it to the after update field but there is no after
update field in the events . I am not sure wheer I have gone wrong.

Any suggestions would be appreciated
Thanks
Tom

  #4  
Old December 19th, 2008, 04:35 PM posted to microsoft.public.access.tablesdbdesign
Tom
external usenet poster
 
Posts: 1,359
Default event help

I tried that Clifford but the message stills displays even when the restock
level is not less than the todays inventory field. I only want the warning
when it violates that.



"Clifford Bass" wrote:

Hi Tom,

Put it in the Detail section's On Format event. You may also want to
check out the conditional formatting option (Report Design Tools, Design
ribbon, Font section).

Clifford Bass

"Tom" wrote:

I am in access 2007 and I have a table called inventory with the following
fields included:
I have a field called [restock level] and it is numeric
a field called [current purchases] which is numeric
and a field called [current inventory level] which is numeric

I created a query and included a calculated field called todays inventory
which subtracts [current purchases] from the [current inventory level]

I created a report based on the inventory query . it could just as easily be
a form



In that report I would like a message to display if the number in [todays
inventory] is less than or equal to the [restock level]

i created a warning label saying that reorder immmediately
I named the label restockmsg

I made some simple code and tried to attach it to the todays inventory field

If [todays inventory] = [restock level] Then
[restockmsg].Visible = True
[restock level].ForeColor = 255
Else
[restockmsg].Visible = False
[restock level].ForeColor = 0
End Sub

I would like to attach it to the after update field but there is no after
update field in the events . I am not sure wheer I have gone wrong.

Any suggestions would be appreciated
Thanks
Tom

  #5  
Old December 19th, 2008, 04:48 PM posted to microsoft.public.access.tablesdbdesign
Clifford Bass[_2_]
external usenet poster
 
Posts: 1,295
Default event help

Hi Tom,

Are the actual [todays inventory] and [restock level] fields on the
report also named the same as their sources? If not, use the names of the
fields. You could put a break point in the code on the If line and when it
breaks, inspect the actual values of those fields in code by hovering your
cursor over them. If the condition is true, use Shift-F8 to step through the
code to see what is happening. Otherwise when false, press F5 to continue.
It may be useful to limit your report temporarily to just the records where
the message should display. Then you don't have to deal with it stopping
umpteen times before you get to an actual case.

Hope that helps,

Clifford Bass

"Tom" wrote:

I tried that Clifford but the message stills displays even when the restock
level is not less than the todays inventory field. I only want the warning
when it violates that.

  #6  
Old December 19th, 2008, 06:28 PM posted to microsoft.public.access.tablesdbdesign
Tom
external usenet poster
 
Posts: 1,359
Default event help

Yes they are the same...the conditional formattiing idea works but I would
still liike the user to have a warning message in case they are color blind
etc.

Thanks
tom

"Tom" wrote:

I am in access 2007 and I have a table called inventory with the following
fields included:
I have a field called [restock level] and it is numeric
a field called [current purchases] which is numeric
and a field called [current inventory level] which is numeric

I created a query and included a calculated field called todays inventory
which subtracts [current purchases] from the [current inventory level]

I created a report based on the inventory query . it could just as easily be
a form



In that report I would like a message to display if the number in [todays
inventory] is less than or equal to the [restock level]

i created a warning label saying that reorder immmediately
I named the label restockmsg

I made some simple code and tried to attach it to the todays inventory field

If [todays inventory] = [restock level] Then
[restockmsg].Visible = True
[restock level].ForeColor = 255
Else
[restockmsg].Visible = False
[restock level].ForeColor = 0
End Sub

I would like to attach it to the after update field but there is no after
update field in the events . I am not sure wheer I have gone wrong.

Any suggestions would be appreciated
Thanks
Tom

  #7  
Old December 19th, 2008, 08:51 PM posted to microsoft.public.access.tablesdbdesign
Beetle
external usenet poster
 
Posts: 1,254
Default event help

Is the label also in the Detail section, repeated for every row?

Another option would be to add another calculated field to your query like;

IIf([todays inventory]=[restock level], "Re-Order Immediately", "")

Then use a text box on your report, bound to this calculated quey field.
--
_________

Sean Bailey


"Tom" wrote:

Yes they are the same...the conditional formattiing idea works but I would
still liike the user to have a warning message in case they are color blind
etc.

Thanks
tom

"Tom" wrote:

I am in access 2007 and I have a table called inventory with the following
fields included:
I have a field called [restock level] and it is numeric
a field called [current purchases] which is numeric
and a field called [current inventory level] which is numeric

I created a query and included a calculated field called todays inventory
which subtracts [current purchases] from the [current inventory level]

I created a report based on the inventory query . it could just as easily be
a form



In that report I would like a message to display if the number in [todays
inventory] is less than or equal to the [restock level]

i created a warning label saying that reorder immmediately
I named the label restockmsg

I made some simple code and tried to attach it to the todays inventory field

If [todays inventory] = [restock level] Then
[restockmsg].Visible = True
[restock level].ForeColor = 255
Else
[restockmsg].Visible = False
[restock level].ForeColor = 0
End Sub

I would like to attach it to the after update field but there is no after
update field in the events . I am not sure wheer I have gone wrong.

Any suggestions would be appreciated
Thanks
Tom

  #8  
Old December 19th, 2008, 10:02 PM posted to microsoft.public.access.tablesdbdesign
Clifford Bass[_2_]
external usenet poster
 
Posts: 1,295
Default event help

Hi Tom,

Sean's first point is important. If the message is in a header or
footer, then it most likely is impacted by the last item encountered in the
report. If it is already in the detail, let us know.

Clifford Bass

"Beetle" wrote:

Is the label also in the Detail section, repeated for every row?

Another option would be to add another calculated field to your query like;

IIf([todays inventory]=[restock level], "Re-Order Immediately", "")

Then use a text box on your report, bound to this calculated quey field.
--
_________

Sean Bailey

  #9  
Old December 20th, 2008, 05:33 PM posted to microsoft.public.access.tablesdbdesign
Tom
external usenet poster
 
Posts: 1,359
Default event help

The label was in the detail sectio should i move it to a header or footer?

"Clifford Bass" wrote:

Hi Tom,

Sean's first point is important. If the message is in a header or
footer, then it most likely is impacted by the last item encountered in the
report. If it is already in the detail, let us know.

Clifford Bass

"Beetle" wrote:

Is the label also in the Detail section, repeated for every row?

Another option would be to add another calculated field to your query like;

IIf([todays inventory]=[restock level], "Re-Order Immediately", "")

Then use a text box on your report, bound to this calculated quey field.
--
_________

Sean Bailey

  #10  
Old December 20th, 2008, 08:44 PM posted to microsoft.public.access.tablesdbdesign
Clifford Bass[_2_]
external usenet poster
 
Posts: 1,295
Default event help

Hi Tom,

No. Leave it in the detail. That is where is should be. Do I take it
that it is working now? Or is there still the message for all rows?

Clifford Bass

"Tom" wrote:

The label was in the detail sectio should i move it to a header or footer?

"Clifford Bass" wrote:

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.