Unanswered: Reprt Question --- Urgent help need...
In a unbound textbox named TxtSR on report I placed following code.
Report is based on simple query that receives data from table upon open.
The purpose is to display data (SecondAmt) only at last page and all the previous pages should be null. It works fine but even I dont border of this unbound textbox to display in all the previous pages.
To do so, I also put code in on activate event of the report as follows:
Private Sub Report_Activate()
Dim x As Boolean
x = True
Dim INGBLK As Long, INGWHT As Long
'y = 20
INGBLK = RGB(0, 0, 0)
INGWHT = RGB(255, 255, 255)
If Not IsNull(TxtSR) Then
Me.TxtSR.Visible = True
Me.TxtSR.BorderColor = INGBLK
Me.TxtSR.BorderColor = INGWHT
Me.TxtSR.Visible = False
Off course it dont display data except last page but Border which I dont want on all previous pages.
If I put SecondAmt on report footer then it would not appear exactly below the FirstAmount (another textbox) which calculate (cumulative data from one page to another page). Bcs FirstAmt is placed in page footer. I need SecondAmt exactly after my FirstAmt. Hence only I need to make this invisible.
Pls run form "EXPORT INVOICE" and go to invoice # 10026. The amount is set in US$. Once it appears US$, it would convert in SR @ of 3.75 and will insert value in another box which is automated. But it main amount is not in Dollers the second amount will disappear automatically from report.
The main thing is if the report is more than a page then the converted amount should appear on last page only....
Ok, discovered why it's not working for you.
1) You have the code on "Report_Activate()" which only runs when it i first displayed - Look at what other events you can use.
2) "Page > Pages" will never occur, you want "Page = Pages"
3) Why are you using variabls to assign "RGB(0,0,0)" when you could so easily type in "Me.TxtSR.BorderColor = RGB(0, 0, 0)"
Keep it simple!
I have a working solution if you can't work out what to do from here, but this should hopefully sort you out!
I will have another go a this tonight but that code worked more than fine when I ran it on your report.
EDIT: Just a thought
Access sometimes (mostly) ignores subs that are not declared via the form/report properties.
Open the report and find the event and click the ... button. Then copy the code in!
Let me know if this works please!