falconwing
09-04-2007, 02:25 PM
I've been working on some VBA in Word 2003 with a fairly simple userform. Recently I noticed that assignments to a particular object.value were failing with no error. When I went back to an earlier revision, it worked, yet the only difference was that I had deleted text from an unrelated label.
I figured the userform was corrupt and recreated it from scratch. Now after some further edits, it appears the same problem is back, so I'm assuming it is something obvious that I'm missing that I have screwed up.
The code snippet in question:
Glob_DocType.Value = DocumentType
I ran the debugger past that line and this "immediate" output shows the assignment fails with no error:
debug.Print DocumentType
FFRD
Glob_DocType.Value = "FFRD"
debug.Print Glob_DocType.Value
debug.Print typename(Glob_DocType.Value)
String
debug.Print Glob_DocType.List(0)
FDD
debug.Print Glob_DocType.List(1)
FFRD
debug.Print typename(Glob_DocType)
ListBox
Glob_DocType.Value = Glob_DocType.List(1)
debug.Print Glob_DocType.Value
debug.Print Glob_DocType.Enabled
True
debug.Print Glob_DocType.Visible
True
debug.Print Glob_DocType.Locked
False
Also when I try to enter a value in the "Locals" window, it fails to store, again with no error. Any ideas welcome as this is driving me nuts.
Thanks
I figured the userform was corrupt and recreated it from scratch. Now after some further edits, it appears the same problem is back, so I'm assuming it is something obvious that I'm missing that I have screwed up.
The code snippet in question:
Glob_DocType.Value = DocumentType
I ran the debugger past that line and this "immediate" output shows the assignment fails with no error:
debug.Print DocumentType
FFRD
Glob_DocType.Value = "FFRD"
debug.Print Glob_DocType.Value
debug.Print typename(Glob_DocType.Value)
String
debug.Print Glob_DocType.List(0)
FDD
debug.Print Glob_DocType.List(1)
FFRD
debug.Print typename(Glob_DocType)
ListBox
Glob_DocType.Value = Glob_DocType.List(1)
debug.Print Glob_DocType.Value
debug.Print Glob_DocType.Enabled
True
debug.Print Glob_DocType.Visible
True
debug.Print Glob_DocType.Locked
False
Also when I try to enter a value in the "Locals" window, it fails to store, again with no error. Any ideas welcome as this is driving me nuts.
Thanks