I am creating controls with VBA and cannot set the font by referring to them as a control.
I name them and can modify the font if I refer to them by name Me.(control variable name).Font.
I need to know the proper Syntax to make that work.
I think I've tried every combination but none has been successful.
For CountRecords = 0 To rs.RecordCount - 1
tempLeft = 6
For countfields = 0 To rs.Fields.Count - 1
tempname = rs.Fields.Item(countfields).Name & CountRecords
frmtst.Controls.Add "forms.textbox.1", tempname
Set ctl = Me.frmtst(tempname)
Me.test.Font = 14 'set the font on a test textbox
Me.Controls(tempname).Value.Font = 14 '****Trouble line ********
ctl.Width = ((columnwidth(countfields) ^ 0.8) * 10) + 25
ctl.Height = 24
ctl.Left = tempLeft 'templeft + columnwidth(CountFields) + 18
tempLeft = tempLeft + ctl.Width + 3
ctl.Top = 20 * CountRecords + 3
ctl = rs.Fields.Item(countfields).Value
If rs.Fields.Item(countfields).Type = 6 Then
ctl = Format(ctl, "$#,##0.00")
end if
Next countfields
rs.MoveNext
Next CountRecords