P
paul.schrum
Access 2002
The problem I am about to describe can be worked around (via On Error
Goto), but I would still like to understand why this does not work or
how I can do I what want to do without resorting to On Error Goto
I am trying to reference a form that is opened sometimes and closed
other times. Here is my code:
Dim aLbx As ListBox
Dim aFrm As Form
strng = getAllSelectedKeys
Set aFrm = Application.Forms!frm_selectKeyNumber
If Not aFrm Is Nothing Then
Set aLbx = aFrm.Controls(9)
aLbx.RowSource = strng
End If
On the line "Set aFrm = ...", it gives me the message
Runtime error '2450' ... can't find the form 'frm_selectKeyNumber'
refered to ...
What is the recommended way to check to see whether a form is available
to refer to without crashing the routine?
Two Notes: I pasted the name of the form into the module straight from
the Forms object window. This has been working for a few weeks now. I
can not imagine what I did to break it.
- Paul
The problem I am about to describe can be worked around (via On Error
Goto), but I would still like to understand why this does not work or
how I can do I what want to do without resorting to On Error Goto
I am trying to reference a form that is opened sometimes and closed
other times. Here is my code:
Dim aLbx As ListBox
Dim aFrm As Form
strng = getAllSelectedKeys
Set aFrm = Application.Forms!frm_selectKeyNumber
If Not aFrm Is Nothing Then
Set aLbx = aFrm.Controls(9)
aLbx.RowSource = strng
End If
On the line "Set aFrm = ...", it gives me the message
Runtime error '2450' ... can't find the form 'frm_selectKeyNumber'
refered to ...
What is the recommended way to check to see whether a form is available
to refer to without crashing the routine?
Two Notes: I pasted the name of the form into the module straight from
the Forms object window. This has been working for a few weeks now. I
can not imagine what I did to break it.
- Paul