开发者

MSACCESS/VBA: on what page of a report will an object end up on?

开发者 https://www.devze.com 2023-02-04 02:00 出处:网络
Here is what I have: A report with a variable number of pages, with 4 major textboxes. Number of pages depends

Here is what I have:

A report with a variable number of pages, with 4 major textboxes. Number of pages depends on the length of text in the textboxes.

I draw borders around my report, and use the borders of the textboxes to separate the sections.

example:

 _____________  
|1            |  
|             |  
|             |  
|_____________|  
|2            |  
|             |
|             |
|_____________|
|3            |
|_____________|

problem is in some cases, 1 would be too long, so there is an empty part on the bottom of a page. that's not the problem, the problem is it looks like this:

 _____________
|1            |  
|             |  
|             |  
|             |  
|             |  
|             |
|_____________|
|             |
|             |
|_____________|

while I want it to look like this :

 _____________
|1            |  
|             |  
|             |  
|             |  
|             |  
|             |
| 开发者_如何学运维            |
|             |
|             |
|_____________|

Thus I'm trying to add some code to the page event, in order to hide the borders of the last textbox on a page.

Problem is I think once access moves the textboxes around the report to put them in their place, they are already no longer modifiable... Or am I wrong ?

Anyone have an idea on how to solve this ?


I think the easiest way to do this would be to print a line at the top of the section, rather than a border all round.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

Report.ScaleMode = 3
lft = Report.ScaleLeft
top = Me.MyTextbox.Top - 40
wdt = Report.ScaleWidth 
hgt = 1 

Me.Line (lft, top)-Step(wdt, hgt), vbBlack
End Sub
0

精彩评论

暂无评论...
验证码 换一张
取 消