Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ARRG!! What is wrong with this code

Status
Not open for further replies.

RBE

Programmer
May 25, 2000
72
US
I am not getting any error messages or anything it just comes back with a blank value. I have created invisable fields to see if the report was reading the form and other report fields and they are getting to the report fine the code just does not bring back any values. This code is located in the detal section of the report along with all the other rptDGLRPT fields. Helllllp!!!

If (Reports![rptDGLRPT].[PRODUCT CODE] = Forms![frmDGLRPT].[product1]) And (Reports![rptDGLRPT].[running sum] < Forms![frmDGLRPT].[GALLONS1]) Then
Reports![rptDGLRPT].[GALREC]
ElseIf Reports![rptDGLRPT].[running sum] > Forms![frmDGLRPT].[GALLONS1] Then
Reports![rptDGLRPT].[GALLONS_RECEIVED] = Reports![rptDGLRPT].[running sum] - Forms![frmDGLRPT].[GALLONS1]
End If
 
Just a thought (because I do not really know what you are trying to achieve), should the code not be:

If (Reports![rptDGLRPT].[PRODUCT CODE] = Forms![frmDGLRPT].[product1]) Then
If (Reports![rptDGLRPT].[running sum] < Forms![frmDGLRPT].[GALLONS1]) Then
Reports![rptDGLRPT].[GALREC]
Else Reports![rptDGLRPT].[running sum] > Forms![frmDGLRPT].[GALLONS1] Then
Reports![rptDGLRPT].[GALLONS_RECEIVED] = Reports![rptDGLRPT].[running sum] - Forms![frmDGLRPT].[GALLONS1]
End If
End If &quot;Life is full of learning, and then there is wisdom&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top