Re: Reducing the List items on a combo
- From: "Phil Stanton" <phil@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 10:50:57 +0100
On your table have a Field "Selected" as a Yes/No Type
On the open of the form, change all the "Selected" to False
On the close of the form (just to make sure) change all the "Selected" to
False
Your combo box needs a sql somethin like
SELECT Material, MaterialID, Selected FROM MyTable WHERE Selected =False;
2 Columns
Bound Column Column 2
Column Width 5cms; 0 cms
The Update of the Comboboc ("Combo2"
Option Compare Database
Option Explicit
Private Sub Combo2_AfterUpdate()
Dim Mydb As Database
Dim MySet As Recordset
Dim Criteria As String
Set Mydb = CurrentDb
Set MySet = Mydb.OpenRecordset("CoInfo")
Criteria = "MaterialID = " & CLng(Combo2)
With MySet
Do Until !MaterialID = CLng(Combo2)
.MoveNext
Loop
.Edit
!Selected = True 'Then it wont be seen next time
.Update
.Close
Set MySet = Nothing
End With
Combo2.Requery
End Sub
HTH
Phil
<henry.onovwaka@xxxxxxxxx> wrote in message
news:bc5cf4f5-4ebd-412e-8a7d-6f4619386d04@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thank you LARRY,
I quite understand the logic, but sincerely if you can give me an
example.
I am actually using a query as the source, and i want it on the
session i am currently working.
Will be glad if u could help.
.
- References:
- Reducing the List items on a combo
- From: henry . onovwaka
- Re: Reducing the List items on a combo
- From: Larry Linson
- Re: Reducing the List items on a combo
- From: henry . onovwaka
- Reducing the List items on a combo
- Prev by Date: Re: Action pass-through with a form variable Access 2003
- Next by Date: Re: Help with writing to a linked table
- Previous by thread: Re: Reducing the List items on a combo
- Next by thread: Help with writing to a linked table
- Index(es):
Relevant Pages
|