M
Matt Pierringer
I am not sure why, but after I change two fields two a calculated
expression from a query, not a calculation on the report itself, it
stopped working as it normally did. Let me try to be more clear, by
giving examples of my code:
'Calculated Field from query not working
If Me.txtTotal Then
Me.Line48.Visible = True
Me.Line46.Visible = True
End If
'Toggles boxes... this code is currently working
If Me.tgbNoList Or Me.tgbDeleted = True Then
Me.Detail.Visible = False
Else
Me.Detail.Visible = True
End If
'Calculated two fields added together in query(number)
'lblCallForPricing brings up a label saying "Request Price"
'Not Working
If IsNull(Me.txtTotal) Then
Me!lblCallForPricing.Visible = True
Else
Me!lblCallForPricing.Visible = False
End If
txtTotal is on my report and does show up as the total of two numbers.
Here is the equation from txtTotal in the Query:
ttlCost: IIf(IsNull([tblProducts].[Cost]) Or IsNull([tblProducts_1].
[Cost]),"",IIf(IsNull([tblProducts].[Cost]),"",Ceiling([tblProducts].
[Cost]*[tblProducts].[GMR]+[tblProducts].[Cost],0.25))
+IIf(IsNull([tblProducts_1].[Cost]),"",Ceiling([tblProducts_1].
[Cost]*[tblProducts_1].[GMR]+[tblProducts_1].[Cost],0.25)))
tblProducts is my main table I am joining the table on itself with a
number used to identify that a product requires another product, which
is why I need to display both prices then join them.
GMR-Gross Margin Rate(The percentage that the product is being
multiplied by)
Ceiling-The same function from excel, to round to the nearest .25
Public Function Ceiling(ByVal X As Double, Optional ByVal Factor As
Double = 1) As Double
' X is the value you want to round
' is the multiple to which you want to round
Ceiling = (Int(X / Factor) - (X / Factor - Int(X / Factor) > 0)) *
Factor
End Function
Anything I missed, I am sure... but thanks for your help!
-Matt Pierringer
expression from a query, not a calculation on the report itself, it
stopped working as it normally did. Let me try to be more clear, by
giving examples of my code:
'Calculated Field from query not working
If Me.txtTotal Then
Me.Line48.Visible = True
Me.Line46.Visible = True
End If
'Toggles boxes... this code is currently working
If Me.tgbNoList Or Me.tgbDeleted = True Then
Me.Detail.Visible = False
Else
Me.Detail.Visible = True
End If
'Calculated two fields added together in query(number)
'lblCallForPricing brings up a label saying "Request Price"
'Not Working
If IsNull(Me.txtTotal) Then
Me!lblCallForPricing.Visible = True
Else
Me!lblCallForPricing.Visible = False
End If
txtTotal is on my report and does show up as the total of two numbers.
Here is the equation from txtTotal in the Query:
ttlCost: IIf(IsNull([tblProducts].[Cost]) Or IsNull([tblProducts_1].
[Cost]),"",IIf(IsNull([tblProducts].[Cost]),"",Ceiling([tblProducts].
[Cost]*[tblProducts].[GMR]+[tblProducts].[Cost],0.25))
+IIf(IsNull([tblProducts_1].[Cost]),"",Ceiling([tblProducts_1].
[Cost]*[tblProducts_1].[GMR]+[tblProducts_1].[Cost],0.25)))
tblProducts is my main table I am joining the table on itself with a
number used to identify that a product requires another product, which
is why I need to display both prices then join them.
GMR-Gross Margin Rate(The percentage that the product is being
multiplied by)
Ceiling-The same function from excel, to round to the nearest .25
Public Function Ceiling(ByVal X As Double, Optional ByVal Factor As
Double = 1) As Double
' X is the value you want to round
' is the multiple to which you want to round
Ceiling = (Int(X / Factor) - (X / Factor - Int(X / Factor) > 0)) *
Factor
End Function
Anything I missed, I am sure... but thanks for your help!
-Matt Pierringer