Procedure too large, what can I do??

wh00t

Registered User.
Local time
Today, 22:10
Joined
May 18, 2001
Messages
264
Hi I have a large procedure for changing field colours based on certain criteria. The problem is that I need this to happen but now the procedure is too large, can I make this a global procedure and just call it from this form?
 
Code:
Private Sub Form_Timer()


Forms!TrailerParkViewTrans.Refresh
DoCmd.Save

DoCmd.OpenForm "TrailerInfoInput", acNormal, , , , acHidden
Forms!TrailerInfoInput.Filter = "Bay =" & 301
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl301.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl301.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl301.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl301.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl301.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl301.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 302
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl302.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl302.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl302.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl302.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl302.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl302.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 303
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl303.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl303.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl303.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl303.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl303.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl303.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 1
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl1.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl1.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl1.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl1.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl1.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl1.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 2
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl2.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl2.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl2.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl2.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl2.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl2.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 3
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl3.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl3.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl3.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl3.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl3.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl3.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 4
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl4.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl4.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl4.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl4.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl4.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl4.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 5
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl5.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl5.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl5.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl5.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl5.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl5.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 6
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl6.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl6.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl6.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl6.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl6.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl6.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 7
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl7.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl7.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl7.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl7.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl7.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl7.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 8
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl8.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl8.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl8.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl8.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl8.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl8.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 10
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl10.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl10.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl10.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl10.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl10.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl10.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 11
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl11.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl11.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl11.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl11.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl11.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl11.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 12
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl12.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl12.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl12.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl12.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl12.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl2.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 13
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl13.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl13.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl13.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl13.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl3.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl13.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 14
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl14.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl14.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl14.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl14.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl14.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl4.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 15
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl15.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl15.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl15.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl15.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl15.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl15.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 16
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl16.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl16.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl16.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl16.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl16.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl16.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 17
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl17.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl17.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl17.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl17.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl17.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl17.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 18
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl18.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl18.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl18.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl18.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl18.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl18.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 19
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl19.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl19.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl19.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl19.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl19.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl19.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 20
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl20.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl20.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl20.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl20.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl20.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl20.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 21
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl21.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl21.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl21.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl21.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl21.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl21.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 22
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl22.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl22.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl22.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl22.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl22.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl22.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 23
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl23.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl23.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl23.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl23.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl23.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl23.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 24
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl24.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl24.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl24.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl24.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl24.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl24.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 25
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl25.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl25.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl25.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl25.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl25.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl25.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 26
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl26.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl26.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl26.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl26.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl26.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl26.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 27
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl27.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl27.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl27.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl27.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl27.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl27.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 28
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl28.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl28.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl28.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl28.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl28.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl28.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 29
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl29.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl29.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl29.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl29.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl29.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl29.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 30
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl30.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl30.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl30.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl30.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl30.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl30.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 31
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl31.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl31.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl31.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl31.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl31.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl31.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 32
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl32.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl32.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl32.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl32.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl32.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl32.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 33
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl33.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl33.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl33.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl33.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl33.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl33.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 34
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl34.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl34.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl34.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl34.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl34.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl34.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 35
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl35.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl35.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl35.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl35.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl35.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl35.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 36
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl36.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl36.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl36.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl36.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl36.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl36.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 37
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl37.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl37.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl37.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl37.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl37.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl37.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 39
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl39.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl39.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl39.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl39.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl39.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl39.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 40
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl40.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl40.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl40.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl40.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl40.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl40.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 41
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl41.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl41.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl41.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl41.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl41.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl41.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 42
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl42.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl42.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl42.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl42.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl42.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl42.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 43
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl43.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl43.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl43.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl43.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl43.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl43.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 44
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl44.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl44.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl44.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl44.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl44.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl44.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 45
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl45.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl45.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl45.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl45.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl45.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl45.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 46
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl46.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl46.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl46.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl46.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl46.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl46.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 47
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl47.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl47.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl47.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl47.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl47.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl47.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 48
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl48.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl48.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl48.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl48.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl48.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl48.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 49
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl49.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl49.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl49.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl49.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl49.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl49.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 50
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl50.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl50.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl50.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl50.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl50.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl50.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 51
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl51.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl51.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl51.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl51.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl51.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl51.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 52
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl52.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl52.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl52.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl52.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl52.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl52.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 53
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl53.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl53.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl53.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl53.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl53.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl53.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 54
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl54.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl54.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl54.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl54.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl54.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl54.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 55
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl55.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl55.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl55.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl55.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl55.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl55.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 56
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl56.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl56.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl56.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl56.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl56.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl56.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 57
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl57.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl57.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl57.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl57.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl57.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl57.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 58
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl58.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl58.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl58.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl58.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl58.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl58.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 59
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl59.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl59.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl59.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl59.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl59.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl59.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 60
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl60.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl60.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl60.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl60.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl60.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl60.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 61
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl61.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl61.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl61.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl61.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl61.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl61.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 62
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl62.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl62.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl62.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl62.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl62.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl62.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 63
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl63.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl63.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl63.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl63.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl63.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl63.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 64
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl64.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl64.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl64.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl64.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl64.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl64.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 65
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl65.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl65.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl65.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl65.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl65.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl65.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 66
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl66.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl66.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl66.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl66.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl66.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl66.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 67
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl67.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl67.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl67.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl67.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl67.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl67.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 68
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl68.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl68.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl68.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl68.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl68.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl68.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 69
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl69.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl69.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl69.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl69.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl69.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl69.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 70
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl70.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl70.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl70.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl70.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl70.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl70.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 71
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl71.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl71.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl71.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl71.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl71.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl71.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 72
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl72.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl72.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl72.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl72.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl72.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl72.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 73
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl73.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl73.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl73.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl73.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl73.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl73.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 74
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl74.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl74.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl74.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl74.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl74.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl74.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 75
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl75.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl75.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl75.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl75.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl75.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl75.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 76
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl76.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl76.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl76.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl76.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl76.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl76.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 77
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl77.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl77.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl77.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl77.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl77.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl77.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 78
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl78.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl78.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl78.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl78.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl78.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl78.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 79
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl79.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl79.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl79.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl79.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl79.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl79.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

Forms!TrailerInfoInput.Filter = "Bay =" & 80
Forms!TrailerInfoInput.FilterOn = True
If Forms!TrailerInfoInput!Status = "Loaded In" Then
    Ctl80.BackColor = vbGreen
End If
If Forms!TrailerInfoInput!Status = "Pallets Only" Then
    Ctl80.BackColor = vbCyan
End If
If Forms!TrailerInfoInput!Status = "Loaded Out" Then
    Ctl80.BackColor = vbYellow
End If
If Forms!TrailerInfoInput!Status = "Being Loaded" Then
    Ctl80.BackColor = vbBlue
End If
If Forms!TrailerInfoInput!Status = "Empty" Then
    Ctl80.BackColor = vbWhite
End If
If Forms!TrailerInfoInput!Status = Null Then
    Ctl80.BackColor = 16777215
End If
Forms!TrailerInfoInput.FilterOn = False

DoCmd.close acForm, "TrailerInfoInput"

End Sub

it's long, but required for what I need to do.
 
Replace all the If's with Select Case much more efficient. If you have A2k then I believe you can use inbuilt conditional formatting, not sure on the limit though. Not sure why your using the timer event?
 
Do you have a table with all the bay numbers stored, if so you will be able to reduce your code immensely by implementing a looping function to determine the appropriate filter and using a select statement as Rich suggests.
 
Since this code is being executed in the code module of a form, you can use the shorthand Me.YourControlName reference rather than the longer Forms!YourFormName!YourControlName. The following sample will consolidate your code significantly. Just list all the fields one after the other. Multiple imperative statements may be coded within an If or select case.

Code:
Select Case Me.Status
        Case "Loaded In" 
            Ctl301.BackColor = vbGreen
            Ctl80.BackColor = vbGreen
            .....           = vbGreen
        Case  "Pallets Only" 
            Ctl301.BackColor = vbCyan
            Ctl80.BackColor = vbCyan
            .....           = vbCyan
        Case "Loaded Out" 
            Ctl80.BackColor = vbYellow
            ........        = vbYellow
        Case "Being Loaded" 
            Ctl80.BackColor = vbBlue
            ........        = vbBlue
        Case "Empty" 
            Ctl80.BackColor = vbWhite
            .......         = vbWhite
        Case Else
            Ctl301.BackColor = 16777215
            Ctl80.BackColor = 16777215
            .....           = 16777215
    End Select

I didn't count the fields that you were setting or read each and every line so I extrapolated a pattern. I hope that I was correct. If you are changing the color of ALL fields depending on the status field, you should be able to loop through the field collection of the form and reduce the code to about a dozen lines.


[This message has been edited by Pat Hartman (edited 04-25-2002).]
 
Thanx for the replies, I shall try them today

Just a quick explanation of what I am achieving

This is an active view of a Trailer park which is being updated by forms which are used by other sections on site, this code is to change the colour of the trailer bay depending on the state of the trailer to make each status easily identified on the trailer park view.
 
How do I impliment a loop function to filter the form that contains the information I require?
 
Search VBA for 'forward only recordset'. The example details how to open a recordset and loop through records.

Build a loop that returns baynumbers and status fields then include the majority of the procedure inside the loop to eradicate duplicate code *something* like:

Code:
Dim MyDB as DAO.Database
Dim rstBays as DAO.Recordset

Set MyDB = CurrentDB()
Set rstBays = MyDB.OpenRecordset("tblBays",dbOpenForwardOnly)
'do what you did before
Forms!TrailerParkViewTrans.RefreshDoCmd.SaveDoCmd.OpenForm "TrailerInfoInput", acNormal, , , , acHidden

'enumerate through records

With rstBays
' Enumerate the recordset.
Do While Not .EOF

Forms!TrailerInfoInput.Filter = "Bay =" & !BayNo
Forms!TrailerInfoInput.FilterOn = True
'use pats code to resolve control colours
Select Case !Status

Case "Loaded In"             Ctl301.BackColor = vbGreen            Ctl80.BackColor = vbGreen            
.....           = vbGreen        

Case  "Pallets Only"             Ctl301.BackColor = vbCyan            Ctl80.BackColor = vbCyan            
.....           = vbCyan        

Case "Loaded Out"             Ctl80.BackColor = vbYellow            
........        = vbYellow        

Case "Being Loaded"             Ctl80.BackColor = vbBlue            
........        = vbBlue        

Case "Empty"             
Ctl80.BackColor = vbWhite            
.......         = vbWhite        

Case Else            
Ctl301.BackColor = 16777215            Ctl80.BackColor = 16777215            
.....           = 16777215    
End Select

Forms!TrailerInfoInput.FilterOn = False
.MoveNext
Loop
DoCmd.close acForm, "TrailerInfoInput"

(..a suggestion..)
If you have a table where you store the statuses it is efficient to store the control colors in another column. You can reference them using a dlookup rather than having to use a select case statement which may be inefficient and unruly to manage if your colour scheme or statuses ever changed.


There may be typos in the code, so please forgive me for nature only gave me a 14" Monitor.

Ian

EDIT2: As your referred CTL no's change in relation to the BayNo you need to refer to the controls dynamically also, so in the above replace the static Me!Ctl2 with Me("Ctl"& !BayNo), make sense?

[This message has been edited by Fornatian (edited 04-26-2002).]

[This message has been edited by Fornatian (edited 04-26-2002).]
 
So Close

when compiling it halts on End Sub saying expected end with, any ideas?
 
You have to put End With in there somewhere probably just before the End Sub.
No chance of any freebies I suppose
smile.gif
 
You wouldn't happen to be on London Road, Trent Vale by any chance?
smile.gif
 
The short answer is: Hire a professional!!

Good God Gertie, that has to be the longest, most convoluted request for 'free' assistance I've ever encountered.

Have you no shame?

Bob

[This message has been edited by raskew (edited 04-29-2002).]

[This message has been edited by raskew (edited 04-29-2002).]
 
Bob,
Not everyone has the skills or knowledge to get it right first time. As you will know from your 2 edits
wink.gif
, but I did notice the net get a bit slower after that post
 
I think you could get your 1000's of lines of repeating code down to 1 line.

Your status should have a numerical ID that you refer to it by. - if status = 1 then... - not, if status = "Loading"

'Populate Array with colors in corresponding order to StatusID
Dim Arr(5) as integer ' Assumes Option Base 1
arr(1) = "vbGreen"
arr(2) = "vbYellow"
arr.... etc...

'Open recordset instead of filtered record
dim db as database
dim rs as recordset

set db = currentdb()
set rs = db.OpenRecordset("YourTable or Query Name") ' (instead of filtered form)
rs.MoveFirst

Do while not rs.EOF

YourObject'sColor = arr(Status)

rs.movenext
loop

rs.close
set rs = nothing
set db = nothing
 
Last edited:

Users who are viewing this thread

Back
Top Bottom