carlnewton
Registered User.
- Local time
- Yesterday, 19:00
- Joined
- Jan 10, 2008
- Messages
- 19
I'm simply trying to select an item in a bound listbox. When I do this, the form locks up. I added a setfocus to an unbound button and that generated Reserved Error 2950. Stumped again.
Dim lg As Long, lgIndex As Long, lgLastUser As Long
With Me
lgLastUser = Val(!LastUser.Caption)
DoCmd.RunCommand acCmdAppMaximize
DoCmd.Restore
' do this routine to select the last front-end user
If Not Nz(!LastUser.Caption, "") = "" Then
With !unbUsername
lgIndex = .ListCount
Do Until lgIndex = -1
If .ItemData(lgIndex) = lgLastUser Then
.Selected(lgIndex) = True
Exit Do
End If
lgIndex = lgIndex - 1
Loop
End With
End If
!btnLogin.SetFocus
End With
Suggestions?
Dim lg As Long, lgIndex As Long, lgLastUser As Long
With Me
lgLastUser = Val(!LastUser.Caption)
DoCmd.RunCommand acCmdAppMaximize
DoCmd.Restore
' do this routine to select the last front-end user
If Not Nz(!LastUser.Caption, "") = "" Then
With !unbUsername
lgIndex = .ListCount
Do Until lgIndex = -1
If .ItemData(lgIndex) = lgLastUser Then
.Selected(lgIndex) = True
Exit Do
End If
lgIndex = lgIndex - 1
Loop
End With
End If
!btnLogin.SetFocus
End With
Suggestions?
Last edited: