Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't set LimitToList property to no

Status
Not open for further replies.

itchyII

MIS
Apr 10, 2001
167
Hello All,
I have an Access 2000 database. I have a form that schedules events and on it I have a combo box that is populated by a query. The query filters out any team names that are already assigned to an event at the selected time (another box on the form that gets populated before my combo box). I have a listbox below all of this that displays all the events that have been created and when you double click on the event, it loads it up into the boxes above, so that you can make any necessary changes. The problem is that once you create an event a t a certain time, it the team name gets filtered out of the combo box and when my code tries to place the name back in the combo box for display, I get a ‘not in the list’ error. So I thought that I’d simply change the LimitToList property to False before loading the name back in the box, which, in theory should fix my problem. But now I’m getting an error that the db ‘can’t set the LimitToList property to no right now”. Why not??? Is there something that I have to do before setting the LimitToList property?

Code:
Private Sub EventList_DblClick(Cancel As Integer)
Dim item As Variant

'find selected item
For item = 0 To Me.EventList.ListCount - 1
        If Me.EventList.Selected(item) Then
            Me.eventKey_hidden = Me.EventList.Column(0, item)
            Me.StartTime = Format((Me.EventList.Column(2, item)), "hh:mm")
            Me.EndTime = Format((Me.EventList.Column(3, item)), "hh:mm")
            Me.IceSurface = Me.EventList.Column(4, item)
            Me.Event = Me.EventList.Column(5, item)
            If Me.EventList.Column(5, item) = "Partie/Game" Or Me.EventList.Column(5, item) = "Partie Finale/Final Game" Then
                Me.Pool.Visible = True
                Me.Pool_Label.Visible = True
                Me.Pool.SetFocus
                Me.Pool.Text = Me.EventList.Column(6, item)
                Me.TeamA.Visible = True
                Me.TeamA_Label.Visible = True
                Me.TeamA.Requery
                Me.TeamA.LimitToList = False
                Me.TeamA.SetFocus
                Me.TeamA.Text = Me.EventList.Column(7, item)
                Me.TeamB.Visible = True
                Me.TeamB_Label.Visible = True
                Me.TeamB.Requery
                Me.TeamB.LimitToList = False
                Me.TeamB.SetFocus
                Me.TeamB.Text = Me.EventList.Column(8, item)
            Else
                Me.Pool.Visible = False
                Me.Pool_Label.Visible = False
                Me.TeamA.Visible = False
                Me.TeamA_Label.Visible = False
                Me.TeamB.Visible = False
                Me.TeamB_Label.Visible = False
            End If
            item = Me.EventList.ListCount - 1
        End If
Next item

End Sub

Thanks
ItchyII
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top