G
Guest
I have a calculcated field on a form that converts a quantity from metric to
eng if another field on the from is a specified number for various records.
On the form it works great. However, when I use the same code for the
report, it converts all of the records to the same amount. For example: One
record (elemkey 301) is 11159 meters sq and another (elemkey 12) is 289
linear meters. The system sees the elemkey 301 and converts 11159 to square
feet correctly, but it puts the same value for the record elemkey 12, with
289 linear feet. Below is a sample of the code I am using. It appears the
report does not realize there are multiple records and should calculate each
one separatly.
Option Compare Database
Private Sub report_Activate()
Select Case Report_Query2reportsubreport.ELEMKEY
Case "301"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.305
Case "302"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.305
Case "303"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.305
Case "304"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.305
Case "399"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.305
Case "12"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.0929
Case "38"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.0929
Case "98"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.0929
Case "13"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.0929
eng if another field on the from is a specified number for various records.
On the form it works great. However, when I use the same code for the
report, it converts all of the records to the same amount. For example: One
record (elemkey 301) is 11159 meters sq and another (elemkey 12) is 289
linear meters. The system sees the elemkey 301 and converts 11159 to square
feet correctly, but it puts the same value for the record elemkey 12, with
289 linear feet. Below is a sample of the code I am using. It appears the
report does not realize there are multiple records and should calculate each
one separatly.
Option Compare Database
Private Sub report_Activate()
Select Case Report_Query2reportsubreport.ELEMKEY
Case "301"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.305
Case "302"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.305
Case "303"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.305
Case "304"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.305
Case "399"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.305
Case "12"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.0929
Case "38"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.0929
Case "98"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.0929
Case "13"
Report_Query2reportsubreport.Label27.Caption = QUANTITY / 0.0929