Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying one field on top of other fields when creating reports 2

Status
Not open for further replies.

RoyE

Technical User
Jun 25, 2003
10
US
I have a report that I would like to indicate records that have been deleted. I am trying to show the word "DELETED" over the fields in the record that is printed on the report. I have tried this by having my deleted field over the existing records on the report form. However when I view the report in print preview the field hides the records that are not deleted as it contains no text. I was able to do this using Foxpro some years back but have forgotten how.

I need to indicate the records deleted as part of controlling revisions. Our installation contractors use this information to track changes in the design for our construction project.
 
I re-read my post and need to clarify some things. I have records that are not deleted in Access but have a field where I indicate a record has been eliminated from the scope of our contractors work. This field contains a flag that indicates no longer in scope.

What I am desiring to do is to activate either text saying "DELETED", a line through the text to strike out the record, or shade the line. I had done this using Foxpro 2.5 in the past but am not sure how to do this in Access.
 
Roy,

Draw a line control over your detail section. Call it
Code:
lnDeleted

In the On Format event of the detail section, place code like this to evaluate your flag field and set the visibility of the line control:
Code:
If Me.YourFlagField = -1 Then
   Me.lnDeleted.Visible = True
Else
   Me.lnDeleted.Visible = False
End If

Hoc nomen meum verum non est.
 
Thanks for your quick reply.

Sorry, but I was unable to get this to work. I made the strike out line and renamed it. But I was unsure about what to use in the On Format box. There are three selections; Expression Builder, Macro Builder, and Code Builder. I am way behind the times in regard to VB (Code Builder). So I tried to create it in the Expression Builder. This is what I ended up trying:

=IFF([Installation-Ethernet]!OOS=-1,lnDelete.Visible=True,lnDelete.Visible=False)

Installation-Ethernet is my table name, OOS is my Out Of Scope field with true/false selection.

I keep getting this error when I attempt to preview the screen. "The expression On format you entered as the event property setting produced the following error: The expression you entered has a function name that Microsoft Access can't find." I had checked the help for conditional formmating and it used an example of IFF(... )

This seems like it should be simple. :)
 
I would use the Code Builder. Add your OOS field to your report if it isn't there already, and make in invisible if you don't want it to display. Then, your code should be something like this:
Code:
If Me.OOS = -1 Then
   Me.lnDelete.Visible = True
Else
   Me.lnDelete.Visible = False
End If


Hoc nomen meum verum non est.
 
Kramer,

It works! I tried it just as you had presented it. When I looked at this the first time I was getting hung up on the "me." part of the expression.

Thanks again,
Roy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top