I know that since the access 2010 u have the ability to create 50 conditional formatting rules, but i would like to create them dynamicly. Because the user can has the ability to create new rules (rules based on a reminder type). this way the user does not need to conctact us when their is a new reminder type.
It seems possible to create the rules by vba, but their's one problem, when i create the fourth Formatrule, access just override the first 1 again, after creating all the format rules, we just keep the last 3 over.
Via the GUI is it possible to create the 3+ formattingrules.
Dim vControl As control
Dim vTextbox As TextBox
Dim sql As String
Dim rst As New adodb.Recordset
Dim teller As Integer
For Each vControl In Me.Controls
If TypeName(vControl) = "Textbox" Then
teller = 0
Set vTextbox = vControl
sql = "select alarmsoort, weergave_kleur from alarmsoort"
rst.Open sql, G_SQLConn, adOpenForwardOnly, adLockReadOnly
Do Until rst.EOF
vTextbox.FormatConditions.Add acExpression, , "[Alarmsoort] = " & rst!Alarmsoort
vTextbox.FormatConditions(teller).ForeColor = rst!weergave_kleur
teller = teller + 1
this function should create for every textbox on this subform the conditional formats based on the "Alarmsoort" Table.