Hide Record from Report

ra2020sh

New member
Local time
Today, 21:48
Joined
May 16, 2022
Messages
8
hi any help>
i want to genarate report that show only record which have "Not Normal"
if report Field contain text "Normal" then i dont want its shown in my report
if its NOT Normal then i want to see the the record



hide.png

shold be like this :-
Untitledwwwww.png
 

Attachments

So use that criteria with the recordsource.
Use a query and not the table as recordsource.
 
So use that criteria with the recordsource.
Use a query and not the table as recordsource.
thanks for help but my but sorry the example was The example is different

the full report come like this
hide.png


but i need to be like this
only the memo with "NotNormal" shold be shown

hide2.png


i have addeed the attachment file to apply the changes
 

Attachments

Hi. Welcome to AWF!

Is this a continuation of your other thread?

 
That makes no difference to my response.
 
Show the sql for the query which is the report source.
 
i tried this code but work only with first record


If Me.Memo1 = "Normal" Then Me.Memo1.Visible = False
If Me.Memo1 <> "Normal" Then Me.Memo1.Visible = True

If Me.Memo1 = "Normal" Then Me.Memo1_Label.Visible = False
If Me.Memo1 <> "Normal" Then Me.Memo1_Label.Visible = True

If Me.Memo2 = "Normal" Then Me.Memo2.Visible = False
If Me.Memo2 <> "Normal" Then Me.Memo2.Visible = True

If Me.Memo2 = "Normal" Then Me.Memo2_Label.Visible = False
If Me.Memo2 <> "Normal" Then Me.Memo2_Label.Visible = True

If Me.Memo3 = "Normal" Then Me.Memo3.Visible = False
If Me.Memo3 <> "Normal" Then Me.Memo3.Visible = True

If Me.Memo3 = "Normal" Then Me.Memo3_Label.Visible = False
If Me.Memo3 <> "Normal" Then Me.Memo3_Label.Visible = True

If Me.Memo4 = "Normal" Then Me.Memo4.Visible = False
If Me.Memo4 <> "Normal" Then Me.Memo4.Visible = True

If Me.Memo4 = "Normal" Then Me.Memo4_Label.Visible = False
If Me.Memo4 <> "Normal" Then Me.Memo4_Label.Visible = True

If Me.Memo5 = "Normal" Then Me.Memo5.Visible = False
If Me.Memo5 <> "Normal" Then Me.Memo5.Visible = True

If Me.Memo5 = "Normal" Then Me.Memo5_Label.Visible = False
If Me.Memo5 <> "Normal" Then Me.Memo5_Label.Visible = True
 
i tried this code but work only with first record


If Me.Memo1 = "Normal" Then Me.Memo1.Visible = False
If Me.Memo1 <> "Normal" Then Me.Memo1.Visible = True

If Me.Memo1 = "Normal" Then Me.Memo1_Label.Visible = False
If Me.Memo1 <> "Normal" Then Me.Memo1_Label.Visible = True

If Me.Memo2 = "Normal" Then Me.Memo2.Visible = False
If Me.Memo2 <> "Normal" Then Me.Memo2.Visible = True

If Me.Memo2 = "Normal" Then Me.Memo2_Label.Visible = False
If Me.Memo2 <> "Normal" Then Me.Memo2_Label.Visible = True

If Me.Memo3 = "Normal" Then Me.Memo3.Visible = False
If Me.Memo3 <> "Normal" Then Me.Memo3.Visible = True

If Me.Memo3 = "Normal" Then Me.Memo3_Label.Visible = False
If Me.Memo3 <> "Normal" Then Me.Memo3_Label.Visible = True

If Me.Memo4 = "Normal" Then Me.Memo4.Visible = False
If Me.Memo4 <> "Normal" Then Me.Memo4.Visible = True

If Me.Memo4 = "Normal" Then Me.Memo4_Label.Visible = False
If Me.Memo4 <> "Normal" Then Me.Memo4_Label.Visible = True

If Me.Memo5 = "Normal" Then Me.Memo5.Visible = False
If Me.Memo5 <> "Normal" Then Me.Memo5.Visible = True

If Me.Memo5 = "Normal" Then Me.Memo5_Label.Visible = False
If Me.Memo5 <> "Normal" Then Me.Memo5_Label.Visible = True
 
Suggestions offered are to apply filter so records are not retrieved. Not use VBA to set visibility of controls. However, I now see that each memo is not a record it is a field. Code to set visibility must be in Format or Print event of section controls are located in. These events trigger only for PrintPreview or direct to printer.

Consider:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
With Me
.Memo1_Label.Visible = .Memo1 = "Normal"
.Memo1.Visible = .Memo1 = "Normal"
.Memo2_Label.Visible = .Memo2 = "Normal"
.Memo2.Visible = .Memo2 = "Normal"
.Memo3_Label.Visible = .Memo3 = "Normal"
.Memo3.Visible = .Memo3 = "Normal"
.Memo4_Label.Visible = .Memo4 = "Normal"
.Memo4.Visible = .Memo4 = "Normal"
.Memo5_Label.Visible = .Memo5 = "Normal"
.Memo5.Visible = .Memo5 = "Normal"
.Memo6_Label.Visible = .Memo6 = "Normal"
.Memo6.Visible = .Memo6 = "Normal"
End With
End Sub
or
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim x As Integer
With Me
For x = 1 To 6
    .Controls("Memo" & x & "_Label").Visible = .Controls("Memo" & x) = "Normal"
    .Controls("Memo" & x).Visible = .Controls("Memo" & x) = "Normal"
Next
End With
End Sub
Need to remove the layout that is grouping controls. Select controls and right click: Layout > Remove Layout.
Could simplify by removing labels. They aren't really informative. Should certainly reduce size of labels and widen textboxes.
However, there will still be blank space where controls sit. Set textbox CanShrink to Yes. Occupied space will reduce but spacing will look a bit uneven.

An option is to normalize structure with a dependent table for memos where each memo is a record. A sub report can have filter to exclude the "Not Normal" records.
 
Last edited:
You are confusing control names with values of control.
My idea is to omit normal records from the source.
 
Suggestions offered are to apply filter so records are not retrieved. Not use VBA to set visibility of controls. However, I now see that each memo is not a record it is a field. Code to set visibility must be in Format or Print event of section controls are located in. These events trigger only for PrintPreview or direct to printer.

Consider:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
With Me
.Memo1_Label.Visible = .Memo1 = "Normal"
.Memo1.Visible = .Memo1 = "Normal"
.Memo2_Label.Visible = .Memo2 = "Normal"
.Memo2.Visible = .Memo2 = "Normal"
.Memo3_Label.Visible = .Memo3 = "Normal"
.Memo3.Visible = .Memo3 = "Normal"
.Memo4_Label.Visible = .Memo4 = "Normal"
.Memo4.Visible = .Memo4 = "Normal"
.Memo5_Label.Visible = .Memo5 = "Normal"
.Memo5.Visible = .Memo5 = "Normal"
.Memo6_Label.Visible = .Memo6 = "Normal"
.Memo6.Visible = .Memo6 = "Normal"
End With
End Sub
or
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim x As Integer
With Me
For x = 1 To 6
    .Controls("Memo" & x & "_Label").Visible = .Controls("Memo" & x) = "Normal"
    .Controls("Memo" & x).Visible = .Controls("Memo" & x) = "Normal"
Next
End With
End Sub
Need to remove the layout that is grouping controls. Select controls and right click: Layout > Remove Layout.
Could simplify by removing labels. They aren't really informative. Should certainly reduce size of labels and widen textboxes.
However, there will still be blank space where controls sit. Set textbox CanShrink to Yes. Occupied space will reduce but spacing will look a bit uneven.

An option is to normalize structure with a dependent table for memos where each memo is a record. A sub report can have filter to exclude the "Not Normal" records.
Thanks alot can i remove these empty plank lines "red" to get more space for printting perpose
laaaaaaa.png
 
I described that in my earlier post. Read it again.

Also, reduce Detail section size. Set its CanGrow and CanShrink properties to yes.
 
this is but another alternative.
i made a table taskZZ and a report for it.
then i add the subreport to your report.
 

Attachments

Perhaps use a Union query instead then?
 

Users who are viewing this thread

Back
Top Bottom