When do Controls become live?

A

Alain

Hi,

Access 2000.

I have a tabbed notebook on the main form. When I initialize the data at
startup, I notice that a control is NULL for quite a while. WHEN do
controls get instantiated (or get a value)?

Thanks.
 
R

Rick Brandt

Alain said:
Hi,

Access 2000.

I have a tabbed notebook on the main form. When I initialize the data at
startup, I notice that a control is NULL for quite a while. WHEN do
controls get instantiated (or get a value)?

My understanding was that by the time the Load event is running all the controls
should have their values set from the RecordSet.
 
A

Alain

Hi Rick,

Thanks for your answer.

The point is not about data loading; it is that the Control's value is NULL (it does
not exist) so that I cannot refer to any of its properties

Statement : if IsNull(MyComboBox) returns True at startup. So that MyComboBox.Text,
for example, generates an error.

My question was: until WHEN? At what point is MyComboBox (and all controls) NOT
NULL?

Have a good day.

Alain

Rick Brandt a écrit :
 
R

Rick Brandt

Hi Rick,

Thanks for your answer.

The point is not about data loading; it is that the Control's value is NULL (it does
not exist) so that I cannot refer to any of its properties

Statement : if IsNull(MyComboBox) returns True at startup. So that MyComboBox.Text,
for example, generates an error.

My question was: until WHEN? At what point is MyComboBox (and all controls) NOT
NULL?

That is what I was addressing. My understanding is that by the time you get to the
load event you should be able to test the value of all bound controls. If you cannot
then something else is going on.
 
K

Ken Snell

Alain -

In VBA, the .Text property is not available for a control unless the control
has the focus. Use the .Value property instead.

--
Ken Snell
<MS ACCESS MVP>

Hi Rick,

Thanks for your answer.

The point is not about data loading; it is that the Control's value is NULL
(it does
not exist) so that I cannot refer to any of its properties

Statement : if IsNull(MyComboBox) returns True at startup. So that
MyComboBox.Text,
for example, generates an error.

My question was: until WHEN? At what point is MyComboBox (and all controls)
NOT
NULL?

Have a good day.

Alain

Rick Brandt a écrit :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top