View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default timing sensetive code?

Try firing your initialization actions from the UserForm initialize event.
So the sequence is

Load UserForm
Initialize the controls from the UF Initialize event
UserForm Show

--

Regards,
Nigel




"TimK" wrote in message
...
I have a module based subroutine which is activated by a button on a button
bar. The code loads a userform and initializes it with data before making
it
visible for entry and changes. The problem I'm seeing is that my
initialization actions don't appear to work when I run normally, but when
I
trap the execution and step through it, everything is working as it
should,
i.e. all data is transfered as desired. But when I run it full speed, the
userform comes up blank as if not of the transfers took place. A snippet
of
code from this module based code is shown below. I haven't a clue what
could
be causing this problem.....

If usePS Then
.TextBox27.Value = psws.Cells(p.BuildID, usercol) 'build id
.ComboBox8.Value = psws.Cells(p.Priority, usercol) 'Priority
.ComboBox25.Value = psws.Cells(p.Sprint, usercol) 'Sprint Par
found
.ComboBox9.Value = psws.Cells(p.Status, usercol) 'Status
.ComboBox3.Value = psws.Cells(p.Detect, usercol) 'detection
activity
.ComboBox17.Value = psws.Cells(p.ReTestedBy, usercol) 'ReTested By
.ComboBox28.Value = psws.Cells(p.Test, usercol) 'Test case
Else
.TextBox27.Value = ""
.ComboBox25.Value = ""
.ComboBox8.Value = "" ' having a timing problem with above
sets...
.ComboBox9.Value = ""
.ComboBox3.Value = ""
.ComboBox17.Value = ""
.ComboBox28.Value = ""
End If