combo box help!

Prav_i
04-03-2002, 05:39 PM
Hey im new to this site but i'm having problems with using combo boxes to dispay data.

i am creating a hospital eqipment loan system

basically i have a random file which holds data on Equipment Item details ( fields include: EquipmntID, Description etc) , data is input into the files using txt boxes on the form 'frmEquiptItem'.

On the Loan form (frmLoan) i have a combo box that i want to display the EquipmentID's from the form 'frmEquiptItem'. I have managed to display this data using this code in the form load of frmLoans:


Dim i As Integer
Dim NoOfLoansRec As String

Private Sub Form_Load()


NoOfLoansRec = LOF(3) / Len(Loan)

For i = 1 To NoOfLoansRec

Get #3, i, EquiptItem.EquiptID

cmbEquipmentID.AddItem EquiptItem.EquiptID

Next i

End Sub


i have managed to get this function working so that once a new EquipmentID has been entered using the form 'frmEquipmentItem' it is then displayed in the combo box on the loan form (frmLoan)

what i would also like to display is the Description of the EquipmentID in a text box below (called txtDescription). So that once an EquipmentID is selected from the combo box on frmLoans then the correct Desctiption is also displayed in a text box below.


Can anybody help me?? thanks

Anis
04-03-2002, 10:37 PM
The way your are loading data in combo box, the same way load that specified record into a text box...

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum