Data stays in old place after format change!

Johnrg

Registered User.
Local time
Today, 23:32
Joined
Sep 25, 2008
Messages
115
Guys,

I have changed the formatting in a report (the order the data shows under each heading) and now the data in each feild is appearing in the incorrect place (old place) when the report runs.

I have checked and double checked all the cell names and everything seems correct: I am really stumped on this one!

The original report from left to right was 5.2, 5.4, 5.7, 6.0, 6.6, 7.2

I have changed this around so it now reads 5.4, 5.7, 6.0, 5.2, 6.6, 7.2 but the data is still appearing in the old place!

I think it may have something to do with this event procedure code in the format box for the detail but don't know for sure or how to fix it.

Can someone look and advise?

Please be gentle on the code talk!




Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim Ctrl As Control
For Each Ctrl In Me.Controls
If Ctrl.ControlType = acTextBox Then
If Left$(Ctrl.Name, 3) = "New" Then
If IsNull(Ctrl) = True Then
Ctrl.Visible = False
Else
Ctrl.Visible = True
End If
End If
End If
Next Ctrl
If Me.OrigValLocation <> Me.NewLocation Then Me.OrigValLocation.Visible = True Else Me.OrigValLocation.Visible = False
If Me.OrigValStatus <> Me.NewPackStatus Then Me.OrigValStatus.Visible = True Else Me.OrigValStatus.Visible = False
If Me.OrigValTreatment <> Me.NewTreatment Then Me.OrigValTreatment.Visible = True Else Me.OrigValTreatment.Visible = False
If Me.OrigValDrying <> Me.NewDrying Then Me.OrigValDrying.Visible = True Else Me.OrigValDrying.Visible = False
If Me.OriginalMarket <> Me.NewMarket Then TbMarket = "Market: " & OriginalMarket Else Me.TbMarket = ""
 
Last edited:
Changing the name of the controls won't change the displayed data.
This is set by the Control Source property.
Enter the name of the field from the Record Source that you want the control to display.

The contol name is arbitrary.
The lablel name is also arbitrary but its Caption property is what the label displays.
 
Thanks for the reply,
I got it sorted, there was a background set of cells that I had not seen, once these were changed the problem was sorted.
Thanks
JohnG
 

Users who are viewing this thread

Back
Top Bottom