eed
06-29-2004, 10:37 AM
Hi,
I am working on a piece of code which, based on the user's selection, loops through all the db forms and changes several properties of all label controls. Among other things, I want the code to change the labels' bg color based on user selection, but I never want the labels' bg style to be transparent.
I started with all labels set to normal, and the default control style is normal. My code specifically sets it to normal as well. After the code runs, the default control style is set to normal, but EVERY LABEL has reverted to transparent. I cannot figure out why they are doing this!! I am confused and frustrated.
Please help if you can. I have posted the most relevant chunk of my code below, dunno if it will help or not, please ask if more info would help you help me!! Suggestions are deeply appreciated. Thank you so much!!!
For Each doc In ctr.Documents
DoCmd.OpenForm doc.Name, acDesign, , , , acHidden
Set frm = Forms(0)
If frm.Tag = "BGNrml_TextNrml" Then
With frm
.Section(acDetail).BackColor = 16764057
.Section(acPageHeader).BackColor = 16764057
.Section(acPageFooter).BackColor = 16764057
.Section(acHeader).BackColor = 16764057
.Section(acFooter).BackColor = 16764057
End With
End If
For Each ctl In frm.Controls
If ctl.Tag = "BGNrml_TextNrml" Then
ctl.BackStyle = Normal
ctl.BackColor = 16764057
ctl.ForeColor = 0
ElseIf ctl.Tag = "BGNrml_TextHighlight" Then
ctl.BackStyle = Normal
ctl.BackColor = 16764057
ctl.ForeColor = 16711680
ElseIf ctl.Tag = "BGHighlight_TextDrk" Then
ctl.BackStyle = Normal
ctl.BackColor = 16776960
ctl.ForeColor = 0
ElseIf ctl.Tag = "LineNrml" Then
ctl.BorderColor = 0
ElseIf ctl.Tag = "LineHighlight" Then
ctl.BorderColor = 16711680
End If
Next ctl
DoCmd.close acForm, doc.Name, acSaveYes
Next doc
I am working on a piece of code which, based on the user's selection, loops through all the db forms and changes several properties of all label controls. Among other things, I want the code to change the labels' bg color based on user selection, but I never want the labels' bg style to be transparent.
I started with all labels set to normal, and the default control style is normal. My code specifically sets it to normal as well. After the code runs, the default control style is set to normal, but EVERY LABEL has reverted to transparent. I cannot figure out why they are doing this!! I am confused and frustrated.
Please help if you can. I have posted the most relevant chunk of my code below, dunno if it will help or not, please ask if more info would help you help me!! Suggestions are deeply appreciated. Thank you so much!!!
For Each doc In ctr.Documents
DoCmd.OpenForm doc.Name, acDesign, , , , acHidden
Set frm = Forms(0)
If frm.Tag = "BGNrml_TextNrml" Then
With frm
.Section(acDetail).BackColor = 16764057
.Section(acPageHeader).BackColor = 16764057
.Section(acPageFooter).BackColor = 16764057
.Section(acHeader).BackColor = 16764057
.Section(acFooter).BackColor = 16764057
End With
End If
For Each ctl In frm.Controls
If ctl.Tag = "BGNrml_TextNrml" Then
ctl.BackStyle = Normal
ctl.BackColor = 16764057
ctl.ForeColor = 0
ElseIf ctl.Tag = "BGNrml_TextHighlight" Then
ctl.BackStyle = Normal
ctl.BackColor = 16764057
ctl.ForeColor = 16711680
ElseIf ctl.Tag = "BGHighlight_TextDrk" Then
ctl.BackStyle = Normal
ctl.BackColor = 16776960
ctl.ForeColor = 0
ElseIf ctl.Tag = "LineNrml" Then
ctl.BorderColor = 0
ElseIf ctl.Tag = "LineHighlight" Then
ctl.BorderColor = 16711680
End If
Next ctl
DoCmd.close acForm, doc.Name, acSaveYes
Next doc