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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Movelayout property problem

Status
Not open for further replies.

kaarde

Programmer
Jul 29, 2008
5
0
0
CA
Hi,

I'm trying to do a report in the format of the image attached to this thread (the lower part of the image). It has employee information on the right side and schedule information on the left side (informations are ClientName, DebutTime, FinalTime). Each employee has many schedules. I wanted to have all schedules on the same line, so I used the Movelayout = False and the left property to place the schedule under it's date.

The user types the first day on a form and then the report opens. The schedule has been built as a subreport which is linked with the EmployeeID.

The problem is that some records don't show up on the preview, it seems the movelayout and the Canshrink, Cangrow are the culprits. Let me explain, with Movelayout = True, I can see each record on differents lines and when I start moving the textboxes, some records are seen partially (see top of image in attachment) and I would like the cangrow and canshrink to be false.

In the image, the first employee should have 3 schedules and the second one have 4 schedules.

Can someone help on this matter.

Thanks for your time

Here is my VBA code for the subreport

Option Compare Database
Dim DateDebut As Date
Dim varOpenedOnce As Integer
-----------------------------------------------------------
Private Sub EntêteGroupe0_Format(Cancel As Integer, FormatCount As Integer)

Me.txtFirstDay = DateDebut
Me.txtSecondDay = DateDebut + 1
Me.txtThirdDay = DateDebut + 2
Me.txtFourthDay = DateDebut + 3
Me.txtFifthDay = DateDebut + 4
Me.txtSixthDay = DateDebut + 5
Me.txtSeventhDay = DateDebut + 6
Me.txtEighthDay = DateDebut + 7

End Sub
----------------------------------------------------------
Private Sub Report_Open(Cancel As Integer)

Dim strSQL As Variant

strSQL = ""

strSQL = Me.Parent.OpenArgs

If varOpenedOnce = 0 Then
If Not IsNothing(strSQL) Then
DateDebut = ExtractElement(strSQL, 2, "#")
Me.RecordSource = strSQL
varOpenedOnce = 1
End If
End If

End Sub
----------------------------------------------------------
Private Sub Détail_Format(Cancel As Integer, FormatCount As Integer)

Dim xwidth As Integer
xwidth = Me.txtClient.Width

Select Case ScheduleDate

Case txtFirstDay.Value
Me.txtClient.Left = 0
Me.txtDebutTime.Left = 0
Me.txtFinalTime.Left = 0
Case txtSecondDay.Value
Me.txtClient.Left = xwidth
Me.txtDebutTime.Left = xwidth
Me.txtFinalTime.Left = xwidth
Case txtThirdDay.Value
Me.txtClient.Left = xwidth * 2
Me.txtDebutTime.Left = xwidth * 2
Me.txtFinalTime.Left = xwidth * 2
Case txtFourthDay.Value
Me.txtClient.Left = xwidth * 3
Me.txtDebutTime.Left = xwidth * 3
Me.txtFinalTime.Left = xwidth * 3
Case txtFifthDay.Value
Me.txtClient.Left = xwidth * 4
Me.txtDebutTime.Left = xwidth * 4
Me.txtFinalTime.Left = xwidth * 4
Case txtSixthDay.Value
Me.txtClient.Left = xwidth * 5
Me.txtDebutTime.Left = xwidth * 5
Me.txtFinalTime.Left = xwidth * 5
Case txtSeventhDay.Value
Me.txtClient.Left = xwidth * 6
Me.txtDebutTime.Left = xwidth * 6
Me.txtFinalTime.Left = xwidth * 6
Case txtEighthDay.Value
Me.txtClient.Left = xwidth * 7
Me.txtDebutTime.Left = xwidth * 7
Me.txtFinalTime.Left = xwidth * 7
End Select

If (ScheduleDate >= txtFirstDay.Value And ScheduleDate <= txtEighthDay.Value) Then
Me.MoveLayout = False
End If

End Sub
 
Hi Duane,

thanks for your help. Sorry for poor quality of the pictures.

First, the movelayout=false idea came from your calendar type reports, I've studied them before and made another calendar similar to your layout that did work pretty well, but ain't what the company wants :(

I've read about the overlapping problem before and I made sure none of my controls were overlapping.

Here's a first image of my subreport in Creation Mode, as you can see I have spaces between my textboxes and the orange color was to be able to witness the spaces in preview mode. In this image on the left side, there is a textbox, that is my ScheduleDate that I compare to the dates to be able to place the record at the right spot. This textbox is visible=false and is not moving with left properties. I've move this text box around and it doesn't change anything, so I don't think it may be my problem. Here's the link to the image

This second image is the preview mode of my schedule with movelayout=true, as you can see the records all show up with no problem.

The third image is when I turn on (off) the Movelayout = False, some records aren't showing up and one records is only partial.

Thanks for your help, I appreciate it
 
I think your issue is that you need to have a taller employee ID footer. If you note my example, there is a section following the detail section that is the same height as the detail section. This is used to render the layered details.

Duane
Hook'D on Access
MS Access MVP
 
Thanks Duane,

I finally found the culprit. It wasn't the Group footer. I decided to look at every properties of your annual calendar and copy them and then I stumbled upon the AlternateBackColor property in the Detail Properties which wasn't set to No Colors and now it works !:)

I've tested with the footer properties and it seems even with no footer it stills works and I've changed the Cangrow and Canshrink properties to False and it still works.

I've attached the working version.

Thank you Duane


For those who have a similar problem, change the AlternateBackColor property to No Color.
 
 http://www.savefile.com/files/1698115
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top