I am trying to dynamically create controls on a form as needed and I have therefore used the CreateControl Method.
DateControls(i) = CreateControl(Reports!Comments_R, acTextBox, acDetail, , , TopValue, 0, 5400, 1440)
In the following line of code above, when I try to compile the project "CreateControl" is highlighted and a popup box indicates that there is a type mismatch. DateControl is declared as a Control. I have also tried declaring it as a Variant and I still receive the same error. Another time I tried it without using an array and again, still the same error. Any ideas as to what could be wrong?
Thank you.
DateControlbut your code saysDateControls. Do you haveOption Explicitat the top of your VBA Module? If not, you should put it there. - Gord Thompson