Run Report of Current Record of Subform

S

sonofroy

Hello I am currently have a macro set to run a report when I run the "On
Click" event from a checkbox in the subform. The problem I have is that it
runs everyrecord in that subform and I only want it to run the current record
in that subform. there is a where condition set for a field in the main part
of the form [Commission Number] but I also want the subform [frmVehInsp]
current record when I click on the check box [Issue]. Any ideas?
 
D

Duane Hookom

Add to your WHERE CONDITION to include the primary key value/field from your
subform.
 
S

sonofroy

Could you elaborate on that please I do not completely understand.

Thank you very much

Duane Hookom said:
Add to your WHERE CONDITION to include the primary key value/field from your
subform.
--
Duane Hookom
Microsoft Access MVP


sonofroy said:
Hello I am currently have a macro set to run a report when I run the "On
Click" event from a checkbox in the subform. The problem I have is that it
runs everyrecord in that subform and I only want it to run the current record
in that subform. there is a where condition set for a field in the main part
of the form [Commission Number] but I also want the subform [frmVehInsp]
current record when I click on the check box [Issue]. Any ideas?
 
D

Duane Hookom

I can't elaborate until you elaborate. We don't know how else the report
should be filtered. I expect there is a value in the subform that needs to be
used to filter based on a field in the report's record source. We need this
specific information if you expect more assistance.

Please provide specific field names and data types.

--
Duane Hookom
Microsoft Access MVP


sonofroy said:
Could you elaborate on that please I do not completely understand.

Thank you very much

Duane Hookom said:
Add to your WHERE CONDITION to include the primary key value/field from your
subform.
--
Duane Hookom
Microsoft Access MVP


sonofroy said:
Hello I am currently have a macro set to run a report when I run the "On
Click" event from a checkbox in the subform. The problem I have is that it
runs everyrecord in that subform and I only want it to run the current record
in that subform. there is a where condition set for a field in the main part
of the form [Commission Number] but I also want the subform [frmVehInsp]
current record when I click on the check box [Issue]. Any ideas?
 
S

sonofroy

You know after looking back at both your responses I believe I have figured
it out. I needed an AND statement with the WHERE CONDITION

[COMM NUMBER]=[Forms]![frmvehicles]![Comm Number] And
[InspID]=[Forms]![frmvehicles]![subfrminspection]![InspID]

This got both values needed

Thanks for pointing the way I guess I really did understand!

Duane Hookom said:
I can't elaborate until you elaborate. We don't know how else the report
should be filtered. I expect there is a value in the subform that needs to be
used to filter based on a field in the report's record source. We need this
specific information if you expect more assistance.

Please provide specific field names and data types.

--
Duane Hookom
Microsoft Access MVP


sonofroy said:
Could you elaborate on that please I do not completely understand.

Thank you very much

Duane Hookom said:
Add to your WHERE CONDITION to include the primary key value/field from your
subform.
--
Duane Hookom
Microsoft Access MVP


:

Hello I am currently have a macro set to run a report when I run the "On
Click" event from a checkbox in the subform. The problem I have is that it
runs everyrecord in that subform and I only want it to run the current record
in that subform. there is a where condition set for a field in the main part
of the form [Commission Number] but I also want the subform [frmVehInsp]
current record when I click on the check box [Issue]. Any ideas?
 

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