Hello everyone,
I want to request your help to be able to change the background color of a report using code.
I have used these lines of code in Detail_Format
Me.Detail.BackColor = RGB (255, 188, 84)
Me.Detail.AlternateBackColor = RGB (255, 188, 84)
Those lines do indeed change the color without a problem, but now I need to change the background color based on the content of the Language field. There are 4 languages that I have in the database and the color should change depending on the name of each language. I've tried this code, but it just doesn't change the color and the background goes blank.
If Me.Language = "Spanish" Then
Me.Detalle.BackColor = RGB (255, 188, 84)
Me.Detalle.AlternateBackColor = RGB (255, 188, 84)
End If
I have tried using Case statements instead of If but the result is always the same. I don't have much experience with VBA within Access, so I don't know if there is a specific way to accomplish this.
The report is based on a query.
Beforehand thank you very much. (Sorry if I make mistakes when trying to explain what I need to do. I speak little English.)