My Assistant
![]() ![]() |
|
|
Aug 7 2011, 02:49 PM
Post
#1
|
|
|
UtterAccess Veteran Posts: 408 From: Tennessee |
I'm trying to create a report that looks like a weekly calendar. Is there a way to display the lines around the days in the same row (Sunday - Saturday) short of drawing the lines in the form itself? Some days contain data and others do not; I've set the text field to "can grow." (I hope this makes sense)
Thanks for any help. |
|
|
|
Aug 8 2011, 04:26 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 5,119 From: Dunbar, WV |
Can you describe your setup a little more? By text field do you mean textbox? How many are there? Why do they need to grow? Have you tried putting a border around them?
|
|
|
|
Aug 8 2011, 08:14 AM
Post
#3
|
|
|
UtterAccess Veteran Posts: 408 From: Tennessee |
Thanks projecttoday.
Yes, they are textboxes (7 across). They need to expand. I've tried the border, but the border expands in only one textbox (if that textbox has expanded), and not in the other (unexpanded) text boxes. I don't like this look. Any suggestions? Thanks much! |
|
|
|
Aug 8 2011, 09:06 AM
Post
#4
|
|
|
UtterAccess VIP Posts: 6,171 From: Bethesda, MD USA |
What you can do, is click on each of the Text Boxes, view the Properties and under the Format Tab, almost at the very bottom, change the Can Grow to "Yes".
|
|
|
|
Aug 8 2011, 09:28 AM
Post
#5
|
|
|
UtterAccess Veteran Posts: 408 From: Tennessee |
Thanks RazMaddaz.
All the text boxes are set to "can grow." However, the border doesn't "grow" uniformly for each row. For example, if the text box in column 5 is expanded, but the other text boxes in the other columns of the same row have not (because there is either no text or not as much text), the border is smaller around these text boxes. I'm trying to figure out how to make the border uniform over all text boxes in the same row. Thanks! |
|
|
|
Aug 8 2011, 09:34 AM
Post
#6
|
|
|
UtterAccess VIP Posts: 6,171 From: Bethesda, MD USA |
Have you tried double-clicking on the Detail border and then in the Property Sheet, change the Can Grow to "Yes" there?
|
|
|
|
Aug 8 2011, 09:38 AM
Post
#7
|
|
|
UtterAccess Veteran Posts: 408 From: Tennessee |
Thanks RazMaddaz.
I'm using Access 2007. I don't see a border for the detail section in the property sheet. The "can grow" property for the detail section is set to true. |
|
|
|
Aug 8 2011, 09:42 AM
Post
#8
|
|
|
UtterAccess VIP Posts: 6,171 From: Bethesda, MD USA |
Thanks RazMaddaz. I'm using Access 2007. I don't see a border for the detail section in the property sheet. The "can grow" property for the detail section is set to true. I'm sorry, the detail section was where I meant. Can you upload a copy of your file, WITHOUT ANY PRIVATE DATA and someone can take a took and give a suggestion on how to fix this? |
|
|
|
Aug 8 2011, 10:24 AM
Post
#9
|
|
|
UtterAccess VIP Posts: 1,730 From: Carrollton, TX |
The issue you are encountering is that each day is it's own control, and each control will only "grow" as it needs to. So, if Sunday has a bunch of stuff and needs to grow it will, but if there is nothing on Monday, Monday will not grow. The only thing I can think to do is to find maximum height of the tallest control (at time of formatting) and apply that height to the other six days. To capture the required height in time for it to be "available" when the report is formatting is going to be the trickiest part.
You may need to play around with a few different approaches, but one that I can think of is to establish a 'MaxLength" field in the underlying query that feeds your calendar. Place this code in an outside module: CODE Function MaxOfList(ParamArray varValues()) As Variant Dim i As Integer 'Loop controller. Dim varMax As Variant 'Largest value found so far. varMax = Null 'Initialize to null For i = LBound(varValues) To UBound(varValues) If IsNumeric(varValues(i)) Or IsDate(varValues(i)) Then If varMax >= varValues(i) Then 'do nothing Else varMax = varValues(i) End If End If Next MaxOfList = varMax End Function Call it in your query like thus: MyMaxLen: MaxOfList(Len(SunText),Len(MonText),Len(TueText),Len(WedText),Len(ThuText),Len(F riText),Len(SatText)) The query will now hold an integer value representing the longest string. Now that the longest string is known play around with a few different height values like so: Assuming you can add a Tag Value to your "CalendarDay" control boxes, you could do this in the OnFormat event of your report: CODE Dim MyReqHeight as integer
Dim ctl as Control Select Case MyMaxLen Case < 100 MyReqHeight = 720 ' 1/2" tall - the minumum height, even if all calendar days are empty Case >99 and <200 MyReqHeight = 1440 ' 1" tall Case >199 Case >99 and <200 MyReqHeight = 2880' 2" tall - the maximum height permitted.. End Select For Each ctl in Me.Controls If ctl.Tag = "CalendarDayControl" then ctl.height = MyReqHeight Next ctl |
|
|
|
Aug 8 2011, 11:30 AM
Post
#10
|
|
|
UtterAccess Veteran Posts: 408 From: Tennessee |
|
|
|
|
Aug 8 2011, 12:39 PM
Post
#11
|
|
|
UtterAccess VIP Posts: 6,171 From: Bethesda, MD USA |
eacollie,
Take a look at this Form and see if you might like this instead of the Report.
Attached File(s)
|
|
|
|
Aug 8 2011, 05:04 PM
Post
#12
|
|
|
UtterAccess Veteran Posts: 408 From: Tennessee |
Wow! That looks great RAZmaddaz. I'll take a look at it more carefully.... Thank you so much!
|
|
|
|
Aug 8 2011, 08:43 PM
Post
#13
|
|
|
UtterAccess VIP Posts: 6,171 From: Bethesda, MD USA |
(IMG:style_emoticons/default/yw.gif)
Awesome, glad I could help you!!! FYI, I am going to busy the next few days, so if you have an additional question, you might want to create a new topic. Good luck with your database!!! RAZMaddaz |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 08:12 PM |