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. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|