Whats wrong in this code

It is simply great. It make easier to write the vba code this way.

Thanks for the help.

Have you seen my post # 19 in the same thread ?

With kind regards,
Ashfaque
 
Re Post #19

The attached uses similar code to my last post, when you open your form and click on Monthly Sales a module test_grouping is called.

This module deletes a table then cycles through the records and adds the records to the table as per your requirement. You maybe able to use this tables to populate your worksheet or modify the code for your excel code.
 

Attachments

Another excellent trick.

Thanks a lot

I can further add my fields to temp table and transfer data to excel sheet in desired format.

Regards,
Ashfaque
 
I need call recordset where there is 0 or null value in one of its field. Because most ot the time FreeQty field might be with 0 value. I tried this way into your code but doesn't work. (I already increased fields in tbl_grouping)

If Not IsNull(!FreeQty) Or !FreeQty> 0 Then
rst_output("FreeQty") = ![FreeQty]
Else
rst_output("FreeQty") = "0"
End If

Please advise

Thanks for your efforts...

Regards,
Ashfaque
 
In your Sql you are using T_SOFooter1.FreeQty AS PromoQty where PromoQty is the ALIAS for FreeQty. This Alias must replace FreeQty in the code below, also in the ELSE the "0" should be 0 as it is a number not a string
If Not IsNull(!FreeQty) Or !FreeQty> 0 Then
rst_output("FreeQty") = ![FreeQty]
Else
rst_output("FreeQty") = "0"
End If

Correct Code
If Not IsNull(!PromoQty) Or !PromoQty> 0 Then
rst_output("FreeQty") = ![PromoQty]
Else
rst_output("FreeQty") = 0
End If
 
Bravo...

Thanks for the help.....it works now

Regards,
Ashfaque
 

Users who are viewing this thread

Back
Top Bottom