P
paul.m.henderson
Hi,
I've got a user who is experiencing a problem that is specific to her
computer. In the OnOpen event of a form, I've got a piece of code that
tests whether or not a control has a value:
---------------------------------------------------------------------------------------------------------------------------------
Public Function FormObjectValue(frmName As Form, ctlName As String) As
String
On Error GoTo Error_Routine
' Procedure accepts form name and control name as string and returns
its
' value. Returns null string in the event the object has no value or
does not
' exist on the form.
Dim ctlCurrent As Control
Dim strValue As String
strValue = CStr(convertnulls(frmName.Controls(ctlName).Value,
vbNullString))
FormObjectValue = strValue
Exit_Routine:
Exit Function
Error_Routine:
FormObjectValue = vbNullString
Resume Exit_Routine
End Function
---------------------------------------------------------------------------------------------------------------------------------
The code bugs out in the strValue = CStr.... line and says that no
control with that name exists. However, when I iterate through form
and test for that control it shows up just fine. I've reinstalled the
MDAC (2.8 for Windows XP SP2) and imported all the objects into a blank
ADP (we're using an ADP in an Access 2003 environment) and nothing
seems to help. The same application is running perfectly on many other
machines. Any ideas? Thanks!
I've got a user who is experiencing a problem that is specific to her
computer. In the OnOpen event of a form, I've got a piece of code that
tests whether or not a control has a value:
---------------------------------------------------------------------------------------------------------------------------------
Public Function FormObjectValue(frmName As Form, ctlName As String) As
String
On Error GoTo Error_Routine
' Procedure accepts form name and control name as string and returns
its
' value. Returns null string in the event the object has no value or
does not
' exist on the form.
Dim ctlCurrent As Control
Dim strValue As String
strValue = CStr(convertnulls(frmName.Controls(ctlName).Value,
vbNullString))
FormObjectValue = strValue
Exit_Routine:
Exit Function
Error_Routine:
FormObjectValue = vbNullString
Resume Exit_Routine
End Function
---------------------------------------------------------------------------------------------------------------------------------
The code bugs out in the strValue = CStr.... line and says that no
control with that name exists. However, when I iterate through form
and test for that control it shows up just fine. I've reinstalled the
MDAC (2.8 for Windows XP SP2) and imported all the objects into a blank
ADP (we're using an ADP in an Access 2003 environment) and nothing
seems to help. The same application is running perfectly on many other
machines. Any ideas? Thanks!