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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide record On Format

Status
Not open for further replies.

lbigk

MIS
May 24, 2002
58
US
Hello, I have a simple If statement for the Details On Format. Please see example below:
If Me.SegmentID>1 Then
Me.Description.Visible=False
Else
Me.Description.Visible=True
End If

It worked just fine, until I added RecordCount field for additional validation. Now, the If statement always jumps to Else, even if the statement is true.
 
I added a field directly on report nbrRecordCount: control source is =1
 
Yes, I am not finding any issues, I did step by step through the code with individual records and even if the statement is true, it jumps to false.
 
I'm not sure what kind of debugging you performed. What do you see in the debug window if you try:
Code:
debug.print Me.SegmentID
If Me.SegmentID>1 Then
   Me.Description.Visible=False
Else
   Me.Description.Visible=True
End If

Duane
Hook'D on Access
MS Access MVP
 
Me.SegmentID is being reset to 1 no matter which record it's on. When I make SegmentID visible on report, it shows what it should be 1,2,3... I am not sure why it's doing that.
 
Apparently there is something significant about SegmentID that you haven't told us. Is this bound to a field or what? Is it a running sum text box?

Is there other code running? What view are you using? What version of Access?

Duane
Hook'D on Access
MS Access MVP
 
I am using Access 2003, the report is based on a simple query, I open report from the form in Preview. SegmentID is one of the fields selected from the table. What I am trying to do is to hide duplicates, if necessary. For example:
SegmentID=1 compared to a record with ID=001
SegmentID=2 compared to a record with ID=002

If SegmentID 1 and 2 are in the same group, SegmentID 2 record should not be shown.
 
I have no idea where the ID field/value comes from. You also mention "in the same group" but don't really define what this means.

Can you just provide some significant fields with values as they currently appear in your report and then how you would like them to appear?

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top