PDA

View Full Version : display combo box value at Form load event isue



technocraze
02-07-2007, 06:35 AM
Hi community experts,

May I knw hw can the values of the combo box be displayed at combo box afterupdate event? I want to achieve in such a way whereby at the form load the value displayed at the combo box will be displayed at the textboxs as well.
Let say S1 happens to be displayed in form load, which mean that values (StudentId, name) corresponding to S1 will be displayed as well.

Combo box - StudentId (unbounded)
TextBoxes - StudentId (unbounded)
name (unbounded)


Private Sub Combo1_AfterUpdate(Cancel As Integer)
Dim stud As Variant
stud = DLookup("IStudentId", "Student", "StudentId = '" & Me.Combo1.Column(0) & "'")
Me.StudentId.Value = stud
End Sub.

moa
02-07-2007, 07:24 AM
Have any of your other threads been solved or have you given up on them?

OBP
02-07-2007, 09:32 AM
moa, that is a very good question, I thought that I had shown how to do this in this Thread
http://vbaexpress.com/forum/showthread.php?t=11217

in the attachment in post #13