Run Report of Current Record of Subform

  • Thread starter Thread starter sonofroy
  • Start date Start date
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?
 
Add to your WHERE CONDITION to include the primary key value/field from your
subform.
 
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?
 
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?
 
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?
 
Back
Top