
pls help : COMBO box or list box
Quote:
>hi there
>i would apprieciate some help please, my problems are
>1. i have a database from which i would like to chose a certain record
>of a field, these recs should automatically be displayed in an combo
>or list box. how do i do this
This is in a Module that I have:
Public Sub LoadCallTypes(ListBoxName As Object)
Set MyDB = Workspaces(0).OpenDatabase(App.Path + "\PDisp.mdb")
Set MyTable = MyDB.OpenRecordset("CallType") ' Open Recordset.
Do Until MyTable.EOF ' Do until end of file.
MyCall = MyTable.Fields("CallType")
ListBoxName.AddItem MyCall
MyTable.MoveNext ' Move to next record.
Loop
End Sub
If you don't need to display all the records, you might want to try to using
"Find"
Quote:
>2. what should i use are combo or a list box, and what difference will
>either make?
I think that is going to be your personal preference, a combo box is used if
you only want (1) record to be viewed and selected, and a list box is used
if you want multiple records viewed and/or selected.