Suppression of name in a list

T

Telesphore

In a provisory report of students, some students whose "Final Mark" field
already contains the mention "EQV" should not appear.
This report is based on a query that contains the field "Final Mark", but in
the report only the names of students appear.
Student no.. 1
Student no.. 2
Student no.. 3
Etc.
Suppose that the student no. 2 already has an "EQV" note, it should not
appear in the report.
I suppose that the VBA code should look like this:

Private Sub Report_Activate()
If IsNull (Me.FinalMark) Then
Me. StudentName .Visible = False
Else
Me. StudentName.Visible = True
End if
End Sub
 
D

Duane Hookom

Typically you would just set the criteria in the report's record source to
filter out the names.

You will not have any success with code in the Report_Activate() event.
 
T

Telesphore

Thank you

I put this filter: <IIf([Final Mark]="EQV","",[Final Mark])> in the field
[Final Mark] of the query, but it doesn't work!
 
D

Duane Hookom

What do you mean by "doesn't work!"? We can't see your data or your query or
your results.

I would think you would just set the criteria under the [Final Mark] column to

<> "EQV"

--
Duane Hookom
Microsoft Access MVP


Telesphore said:
Thank you

I put this filter: <IIf([Final Mark]="EQV","",[Final Mark])> in the field
[Final Mark] of the query, but it doesn't work!
 
T

Telesphore

Thanks again,

I did that, but with <>"EQV" in the criteria under the [Final Mark] no
names appear.

It seems that I must use IsNull or IsEmpty in the criteria, but how?

Thank you


Duane Hookom said:
What do you mean by "doesn't work!"? We can't see your data or your query
or
your results.

I would think you would just set the criteria under the [Final Mark]
column to

<> "EQV"

--
Duane Hookom
Microsoft Access MVP


Telesphore said:
Thank you

I put this filter: <IIf([Final Mark]="EQV","",[Final Mark])> in the
field
[Final Mark] of the query, but it doesn't work!


"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> a écrit dans le message
de
Typically you would just set the criteria in the report's record source
to
filter out the names.

You will not have any success with code in the Report_Activate()
event.

--
Duane Hookom
Microsoft Access MVP


:

In a provisory report of students, some students whose "Final Mark"
field
already contains the mention "EQV" should not appear.
This report is based on a query that contains the field "Final Mark",
but
in
the report only the names of students appear.
Student no.. 1
Student no.. 2
Student no.. 3
Etc.
Suppose that the student no. 2 already has an "EQV" note, it should
not
appear in the report.
I suppose that the VBA code should look like this:

Private Sub Report_Activate()
If IsNull (Me.FinalMark) Then
Me. StudentName .Visible = False
Else
Me. StudentName.Visible = True
End if
End Sub
 
T

Telesphore

Thanks

It works in SQL with HAVING (((Nz([Note_finale],"")) Not)) ((Like "EQV"))

or by creating the following field in design mode:

Field: Nz([Note_finale];"")
Operation: expression
Criteria: Not as "EQV"

The problem was that I needed to see only the records that are empty.

Duane Hookom said:
What do you mean by "doesn't work!"? We can't see your data or your query
or
your results.

I would think you would just set the criteria under the [Final Mark]
column to

<> "EQV"

--
Duane Hookom
Microsoft Access MVP


Telesphore said:
Thank you

I put this filter: <IIf([Final Mark]="EQV","",[Final Mark])> in the
field
[Final Mark] of the query, but it doesn't work!


"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> a écrit dans le message
de
Typically you would just set the criteria in the report's record source
to
filter out the names.

You will not have any success with code in the Report_Activate()
event.

--
Duane Hookom
Microsoft Access MVP


:

In a provisory report of students, some students whose "Final Mark"
field
already contains the mention "EQV" should not appear.
This report is based on a query that contains the field "Final Mark",
but
in
the report only the names of students appear.
Student no.. 1
Student no.. 2
Student no.. 3
Etc.
Suppose that the student no. 2 already has an "EQV" note, it should
not
appear in the report.
I suppose that the VBA code should look like this:

Private Sub Report_Activate()
If IsNull (Me.FinalMark) Then
Me. StudentName .Visible = False
Else
Me. StudentName.Visible = True
End if
End Sub
 
D

Duane Hookom

"I needed to see only the records that are empty" if this is true, just set
the criteria under the field to
Is Null

--
Duane Hookom
Microsoft Access MVP


Telesphore said:
Thanks

It works in SQL with HAVING (((Nz([Note_finale],"")) Not)) ((Like "EQV"))

or by creating the following field in design mode:

Field: Nz([Note_finale];"")
Operation: expression
Criteria: Not as "EQV"

The problem was that I needed to see only the records that are empty.

Duane Hookom said:
What do you mean by "doesn't work!"? We can't see your data or your query
or
your results.

I would think you would just set the criteria under the [Final Mark]
column to

<> "EQV"

--
Duane Hookom
Microsoft Access MVP


Telesphore said:
Thank you

I put this filter: <IIf([Final Mark]="EQV","",[Final Mark])> in the
field
[Final Mark] of the query, but it doesn't work!


"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> a écrit dans le message
de
Typically you would just set the criteria in the report's record source
to
filter out the names.

You will not have any success with code in the Report_Activate()
event.

--
Duane Hookom
Microsoft Access MVP


:

In a provisory report of students, some students whose "Final Mark"
field
already contains the mention "EQV" should not appear.
This report is based on a query that contains the field "Final Mark",
but
in
the report only the names of students appear.
Student no.. 1
Student no.. 2
Student no.. 3
Etc.
Suppose that the student no. 2 already has an "EQV" note, it should
not
appear in the report.
I suppose that the VBA code should look like this:

Private Sub Report_Activate()
If IsNull (Me.FinalMark) Then
Me. StudentName .Visible = False
Else
Me. StudentName.Visible = True
End if
End Sub
 
T

Telesphore

So simple!

Thank you so much.

Telesphore

Duane Hookom said:
"I needed to see only the records that are empty" if this is true, just
set
the criteria under the field to
Is Null

--
Duane Hookom
Microsoft Access MVP


Telesphore said:
Thanks

It works in SQL with HAVING (((Nz([Note_finale],"")) Not)) ((Like "EQV"))

or by creating the following field in design mode:

Field: Nz([Note_finale];"")
Operation: expression
Criteria: Not as "EQV"

The problem was that I needed to see only the records that are empty.

"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> a écrit dans le message
de
What do you mean by "doesn't work!"? We can't see your data or your
query
or
your results.

I would think you would just set the criteria under the [Final Mark]
column to

<> "EQV"

--
Duane Hookom
Microsoft Access MVP


:

Thank you

I put this filter: <IIf([Final Mark]="EQV","",[Final Mark])> in the
field
[Final Mark] of the query, but it doesn't work!


"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> a écrit dans le
message
de
Typically you would just set the criteria in the report's record
source
to
filter out the names.

You will not have any success with code in the Report_Activate()
event.

--
Duane Hookom
Microsoft Access MVP


:

In a provisory report of students, some students whose "Final Mark"
field
already contains the mention "EQV" should not appear.
This report is based on a query that contains the field "Final
Mark",
but
in
the report only the names of students appear.
Student no.. 1
Student no.. 2
Student no.. 3
Etc.
Suppose that the student no. 2 already has an "EQV" note, it should
not
appear in the report.
I suppose that the VBA code should look like this:

Private Sub Report_Activate()
If IsNull (Me.FinalMark) Then
Me. StudentName .Visible = False
Else
Me. StudentName.Visible = True
End if
End Sub
 
T

Telesphore

Function EquivalenceDateObtentionDipl(strTypeDiplôme As Variant) As Date
Select Case strTypeDiplôme
Case TypeDiplôme = "MDIV"
EquivalenceDateObtentionDipl = DateObtention
etc..,

After an essay of normalization, using this function I received the date
December 30 1899!
When it should be 2009-05-15 or May 15 2009!!



Telesphore said:
So simple!

Thank you so much.

Telesphore

Duane Hookom said:
"I needed to see only the records that are empty" if this is true, just
set
the criteria under the field to
Is Null

--
Duane Hookom
Microsoft Access MVP


Telesphore said:
Thanks

It works in SQL with HAVING (((Nz([Note_finale],"")) Not)) ((Like
"EQV"))

or by creating the following field in design mode:

Field: Nz([Note_finale];"")
Operation: expression
Criteria: Not as "EQV"

The problem was that I needed to see only the records that are empty.

"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> a écrit dans le message
de
What do you mean by "doesn't work!"? We can't see your data or your
query
or
your results.

I would think you would just set the criteria under the [Final Mark]
column to

<> "EQV"

--
Duane Hookom
Microsoft Access MVP


:

Thank you

I put this filter: <IIf([Final Mark]="EQV","",[Final Mark])> in the
field
[Final Mark] of the query, but it doesn't work!


"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> a écrit dans le
message
de
Typically you would just set the criteria in the report's record
source
to
filter out the names.

You will not have any success with code in the Report_Activate()
event.

--
Duane Hookom
Microsoft Access MVP


:

In a provisory report of students, some students whose "Final
Mark"
field
already contains the mention "EQV" should not appear.
This report is based on a query that contains the field "Final
Mark",
but
in
the report only the names of students appear.
Student no.. 1
Student no.. 2
Student no.. 3
Etc.
Suppose that the student no. 2 already has an "EQV" note, it
should
not
appear in the report.
I suppose that the VBA code should look like this:

Private Sub Report_Activate()
If IsNull (Me.FinalMark) Then
Me. StudentName .Visible = False
Else
Me. StudentName.Visible = True
End if
End Sub
 
T

Telesphore

Thank you,

Here is the rationale:

We have a database for the students of our school.
Using this database we can print the student marks.
At the end of the course the students obtain a diploma.

rptBulletinNotes is the name of a report activated by a macro.
This report has a Textbox whose control source calls the
"EquivalenceDateObtentionDipl" Function to print the date that the Secretary
has already recorded in the field [DateObten-tion] of the tblDiploma for a
certain kind of diploma [DiplomaType].

For example, a student receives a diploma type “MDIV†on May 15th 2009.

HTH, BTW I just notice that I have published my question in different place
than in "How to populate a textbox in a report with a macro command button
?" objet

KenSheridan via AccessMonster.com said:
Your function is clearly returning a value of zero. In Access the
date/time
data type is implemented as a 64 bit floating point number with its origin
at
30 December 1899 00:00:00. What is DateObtention? It is not passed into
the
function as an argument, so is it a public variable declared in a standard
module? If so how is it assigned a value? If not a public variable, what
is
it?

It would help if you explained the rationale behind this function and the
context in which it is being used.

Ken Sheridan
Stafford, England
Function EquivalenceDateObtentionDipl(strTypeDiplôme As Variant) As Date
Select Case strTypeDiplôme
Case TypeDiplôme = "MDIV"
EquivalenceDateObtentionDipl = DateObtention
etc..,

After an essay of normalization, using this function I received the date
December 30 1899!
When it should be 2009-05-15 or May 15 2009!!
So simple!
[quoted text clipped - 74 lines]
End if
End Sub
 
T

Telesphore

Thank you again.
But, with this new code, I received the following message:

Message :
Erreur d’exécution ‘94’ :
Utilisation incorrecte de Null

And after débogage, the yellow color appeared on these lines :
EquivalenceDateObtentionDipl = _
DLookup("[DateObtention]", "tbDiplômes", strCritère)

I suppose that the following is correct:

In the Source Control of the Zone de texte (Textbox)
=EquivalenceDateObtentionDipl([DateObtention])


KenSheridan via AccessMonster.com said:
So, tblDiploma includes one row for each DiplomaType with the date of
award
for that diploma, correct? If so using the function you'd need to look up
the date in the table for the diploma type in question, which you can do
with
the DLookup function, e.g.

Function EquivalenceDateObtentionDipl(strTypeDiplôme As Variant) As Date

Dim strCritère As String

strCritère = "DiplomaType = """ & strTypeDiplôme & """"

EquivalenceDateObtentionDipl = _
DLookup("[DateObten-tion]", "tblDiploma", strCritère)

End Function

However, you shouldn't really need to call a function at all. By joining
the
tblDiploma table to the table or query which acts as the report's current
Recordsource on the DiplomaType columns you can include the DateObten-tion
in
the query's results and bind a text box in the report to it.

Ken Sheridan
Stafford, England
Thank you,

Here is the rationale:

We have a database for the students of our school.
Using this database we can print the student marks.
At the end of the course the students obtain a diploma.

rptBulletinNotes is the name of a report activated by a macro.
This report has a Textbox whose control source calls the
"EquivalenceDateObtentionDipl" Function to print the date that the
Secretary
has already recorded in the field [DateObten-tion] of the tblDiploma for a
certain kind of diploma [DiplomaType].

For example, a student receives a diploma type “MDIV†on May 15th 2009.

HTH, BTW I just notice that I have published my question in different
place
than in "How to populate a textbox in a report with a macro command button
?" objet
Your function is clearly returning a value of zero. In Access the
date/time
[quoted text clipped - 28 lines]
End if
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top