Making Items Visible on Invisible

Wicklund

Registered User.
Local time
Today, 20:10
Joined
Jun 7, 2002
Messages
56
On a Purchase Order, there may be some instances where it is revised, and some of the items can be cancelled. I am showing items are cancelled by adding an 'Item Cancelled' button for each item. When this button is {Active}, and an item is cancelled, I would like that item to stay on the PO, but have a line drawn through it.

I have accomplished this on the PO Report by using the following code in the [On Format] event.

If Me.Item_Cancelled = -1 Then
[Cancelled Line].Visible = True
Else
[Cancelled Line].Visible = False
End If

In the form however, the line is either visible for all records, or none of the records.

Is there a 'location' to put the code in the form, so the line will be visible for only records where the condition is met (The same as for the report?

Thank you,
 
What I have done, probably not the good way, but at least it works, is a txtbox with a field in the query were I say that if there is datas than txtbox="_______________________" (underlines)

Caution! This is not a good way to code. I'm still looking for a better answer.
 
I don't know the answer to the question about implementing this in your form. I tried to do the same sort of thing and couldn't get it to work.

However, for your reports, you can replace your If / Then / Else statement to the following, which gives the same results:
Code:
[Cancelled Line].Visible = Me.Item_Cancelled
Since Me.Item_Cancelled is either True or False, it's value may be assigned directly to the .visible property without the mincing around.
 
Rich,

Thank you!! Once I understood what your code was doing, I applied it to mine, and it worked perfectly...
 

Users who are viewing this thread

Back
Top Bottom