List index property (1 Viewer)

Rich

Registered User.
Local time
Today, 10:41
Joined
Aug 26, 2008
Messages
2,898
Forms!Invoices![Combo64].ListIndex = 0 has worked fine for years but apparently I'm now using it incorrectly, any ideas?
 

chergh

blah
Local time
Today, 10:41
Joined
Jun 15, 2004
Messages
1,414
Does the combobox have the focus before you set the listindex?
 

Rich

Registered User.
Local time
Today, 10:41
Joined
Aug 26, 2008
Messages
2,898
Yes the actual code is listed here, I guess you can't set the list index from another form

Private Sub InvDate_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

Dim I As Integer
stDocName = "Invoices"
I = Me.Parent.CurrentRecord - 1
DoCmd.OpenForm stDocName

Forms!Invoices!Combo64.SetFocus
Forms!Invoices!Combo64.ListIndex = I
Forms!Invoices!Command73.SetFocus
Forms!Invoices!BeginningDate = Me.InvDate
Forms!Invoices!EndingDate = Me.InvDate
DoCmd.Close acForm, "frmInvAwIss"
End Sub
 

dragofly

Registered User.
Local time
Today, 04:41
Joined
Aug 3, 2010
Messages
23
What error are you getting? Also is I ever negative?
 

Rich

Registered User.
Local time
Today, 10:41
Joined
Aug 26, 2008
Messages
2,898
Error 3777 you've used the list index incorrectly, from what I've read the list index is now read only, another useful update and improvement from Microsoft!:rolleyes:
 

Users who are viewing this thread

Top Bottom