Subreport based on query: Display/print ID number or Full name onl

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have designed a summary report that shows average ratings respondents give
for seminar sessions. I have several subreports based on different queries
that give me a Respondents ID number, full name, and any verbatim comments
the respondent made. Clients and instructors now only want to see the
respondents ID number only if there is no name. I just started learning VB
so, I'm way out of my comfort zone here!

TextBox FullName's control source is =[RspFname]&" "&[RspLname]
RspID (PK) visible property is set to true

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FullName <> Null Then
RspID.Visible = False
Else
RspID.Visible = True
End If
End Sub

No ID or Name prints at all, just comments. Does DisplayWhen work for
controls or for the entire Detail section?

Thanks in advance for any help you can give.
 
When you compare a value with Null don't use = or <> Use instead IsNull

If Not IsNull(FullName) Then
RspID.Visible = False
Else
RspID.Visible = True
End If
******************
Or, to make it in one line

RspID.Visible = IsNull(FullName)
 
When you compare a value with Null don't use = or <> Use instead IsNull

If Not IsNull(FullName) Then
RspID.Visible = False
Else
RspID.Visible = True
End If
******************
Or, to make it in one line

RspID.Visible = Not IsNull(FullName)
 
Thanks very much.
--
the weirder I get, the happier I am


Ofer Cohen said:
When you compare a value with Null don't use = or <> Use instead IsNull

If Not IsNull(FullName) Then
RspID.Visible = False
Else
RspID.Visible = True
End If
******************
Or, to make it in one line

RspID.Visible = IsNull(FullName)

--
Good Luck
BS"D


AccessVBNewB said:
I have designed a summary report that shows average ratings respondents give
for seminar sessions. I have several subreports based on different queries
that give me a Respondents ID number, full name, and any verbatim comments
the respondent made. Clients and instructors now only want to see the
respondents ID number only if there is no name. I just started learning VB
so, I'm way out of my comfort zone here!

TextBox FullName's control source is =[RspFname]&" "&[RspLname]
RspID (PK) visible property is set to true

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FullName <> Null Then
RspID.Visible = False
Else
RspID.Visible = True
End If
End Sub

No ID or Name prints at all, just comments. Does DisplayWhen work for
controls or for the entire Detail section?

Thanks in advance for any help you can give.
 
Back
Top