在我的应用程序中,我正在执行 2 个任务:
显示所有值
cmbrno_click()
显示所有值
cmbfulnm_lostfocus()
cmbrno
的样式设置为 2 下拉列表。
Private Sub CmbFulNM_LostFocus()
RES.Open "student_record_database",CON,adOpenDynamic,adLockOptimistic,adCmdTable
For i = 0 To RES.RecordCount - 1
CmbRNO.Text = RES!ROLLNO 'at this line control goes to the cmbrno_click event which is having same part of coding and executes that also.
TxtFNM.Text = RES!FIRST_NAME 'error like: item not fount in corresponding ordinal
TxtMIDNM.Text = RES!MIDDLE_NAME
TxtLNM.Text = RES!LAST_NAME
TxtADDR.Text = RES!ADDRESS
COMBO1.Text = RES!GRADE
CmbDiv.Text = RES!DIV
CmbBG.Text = RES!BLOOD_GROUP
If CmbRNO.ListCount > 0 Then CmbRNO.ListIndex = i
Next i
RES.Close
End Sub