Conditional Display

C

cdavis82

I am making a database with a list of all of my employees. I have a report
that prints out all of their phone numbers. I just want the report to only
print out active employees. I have a Yes/No object in the table named
"Active". The form I have setup understands it but I'm not sure how to make
the report understand it too.
 
O

Ofer

To the print report command line you can add a criteria

Dim MyWhere As String
MyWhere = "[Yes/No Active FieldName] = True"
Docmd.OpenReport "ReportName", , , MyWhere
 
C

cdavis82

I'm pretty new to Access. Where would I find that?

Ofer said:
To the print report command line you can add a criteria

Dim MyWhere As String
MyWhere = "[Yes/No Active FieldName] = True"
Docmd.OpenReport "ReportName", , , MyWhere

--
\\// Live Long and Prosper \\//
BS"D


cdavis82 said:
I am making a database with a list of all of my employees. I have a report
that prints out all of their phone numbers. I just want the report to only
print out active employees. I have a Yes/No object in the table named
"Active". The form I have setup understands it but I'm not sure how to make
the report understand it too.
 
C

cdavis82

I'm still not sure how to make this work. Any ideas?

cdavis82 said:
I'm pretty new to Access. Where would I find that?

Ofer said:
To the print report command line you can add a criteria

Dim MyWhere As String
MyWhere = "[Yes/No Active FieldName] = True"
Docmd.OpenReport "ReportName", , , MyWhere

--
\\// Live Long and Prosper \\//
BS"D


cdavis82 said:
I am making a database with a list of all of my employees. I have a report
that prints out all of their phone numbers. I just want the report to only
print out active employees. I have a Yes/No object in the table named
"Active". The form I have setup understands it but I'm not sure how to make
the report understand it too.
 
O

Ofer

I'm sorry it took me a while to come back to you, create a button on the form
where you got the active employee, and on the button OnClick event add this
code

Check this link, it might make things more clear

http://www.databasedev.co.uk/report_from_form_record.html

--
\\// Live Long and Prosper \\//
BS"D


cdavis82 said:
I'm still not sure how to make this work. Any ideas?

cdavis82 said:
I'm pretty new to Access. Where would I find that?

Ofer said:
To the print report command line you can add a criteria

Dim MyWhere As String
MyWhere = "[Yes/No Active FieldName] = True"
Docmd.OpenReport "ReportName", , , MyWhere

--
\\// Live Long and Prosper \\//
BS"D


:

I am making a database with a list of all of my employees. I have a report
that prints out all of their phone numbers. I just want the report to only
print out active employees. I have a Yes/No object in the table named
"Active". The form I have setup understands it but I'm not sure how to make
the report understand it too.
 
Top