Ö
Örjan Skoglösa
In a userform I do have the follwing:
If förstaGången Then
With comboInled
.SetFocus
.SelStart = 0
.SelLength = 100
End With
Else
With comboPatNr
.SetFocus
.SelStart = 0
.SelLength = 10
End With
End If
(comboInled and comboPatnr are dropdowns on the form)
The first time the routines runs, "förstaGången" is True and
"comboInled" is selected. Works perfectly.
From the next time the routine runs "förstaGången" is False but
"comboPatNr" is not selected no matter how may times the routine runs.
But then I press Alt+F11 and then Alt+F11 again. After that I run once
more without desired result, but from the second run it works ok.
I do not need to touch anything inside the VBE, it just automatically
shows the userform code and then I toggle back and start the macro.
To be honest I have not really started to search for any error, as it
is not so important, but perhaps someone could suggest something to
look out for.
TIA
Örjan Skoglösa
PS. I use Word97 on Win2K.
If förstaGången Then
With comboInled
.SetFocus
.SelStart = 0
.SelLength = 100
End With
Else
With comboPatNr
.SetFocus
.SelStart = 0
.SelLength = 10
End With
End If
(comboInled and comboPatnr are dropdowns on the form)
The first time the routines runs, "förstaGången" is True and
"comboInled" is selected. Works perfectly.
From the next time the routine runs "förstaGången" is False but
"comboPatNr" is not selected no matter how may times the routine runs.
But then I press Alt+F11 and then Alt+F11 again. After that I run once
more without desired result, but from the second run it works ok.
I do not need to touch anything inside the VBE, it just automatically
shows the userform code and then I toggle back and start the macro.
To be honest I have not really started to search for any error, as it
is not so important, but perhaps someone could suggest something to
look out for.
TIA
Örjan Skoglösa
PS. I use Word97 on Win2K.