I have a Form and a Report is linked to it. What I have done is a Save As on
the Form and saved it in Report Format. What I want to do is be able to run
the report and display the record that is shown on the form. Also I want to
show a label that uses the visible function on the report - shows when a
certain record is displayed.
your in luck, this is an easy thing to accomplish. as for your first
problem, if you are opening the report from a form use the following
code. (assuming the field you want to filter by is called 'ID')
Report_rptTemp.Filter = "[ID] = '" & me.ID & "'"
Report.filteron = true
just copy that code and paste it into your command button after the
code for opening the report. OF course you will have to replace the
text 'rptTemp' with whatever your report is named and you will also
have to replace 'ID' with whatever your field is called, but other than
that this should work.
now for your secod question, to display some label based on if it is a
specific record, in the reports 'Open' you will need and if statement
If me.ID = "some_value" then
SomeLabel.visible=true
end if
you will have to adapt this code to your specific control names
(SomeLabel will be the name of your label, "some_value" is the specific
value you want to display, and 'ID' is still the field) Let me know if
this is not what you were looking for.
~Brian