I get this error when i run, i cant figure out what is wrong
Can some one please help me?
Run-time error '3265': Item cannot be found in the collection corresponding to the requested name or ordinal.
Below is my code
Private Sub Form_Load()
medcon.Connecti onString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=M:\Herba l_Medicine_Data base.mdb;Persis t Security Info=False"
medcon.Open
medrs.Open "Select * from MedDetails ", medcon, adOpenDynamic, adLockOptimisti c
DISP
LockNow
End Sub
Public Sub DISP()
'coding to display record in textbox
If Not (medrs.EOF = True Or medrs.BOF = True) Then
txtRedgNum.Text = medrs.Fields.It em("RedgNum")
txtComplnts.Tex t = medrs.Fields.It em("Complaints" ) ' on debug this is highlighted txtIllns.Text = medrs.Fields.It em("Illness")
txtPstIllns.Tex t = medrs.Fields.It em("PastIllness ")
txtDrgPresc.Tex t = medrs.Fields.It em("DrugPrescri bed")
End If
End Sub
Can some one please help me?
Run-time error '3265': Item cannot be found in the collection corresponding to the requested name or ordinal.
Below is my code
Private Sub Form_Load()
medcon.Connecti onString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=M:\Herba l_Medicine_Data base.mdb;Persis t Security Info=False"
medcon.Open
medrs.Open "Select * from MedDetails ", medcon, adOpenDynamic, adLockOptimisti c
DISP
LockNow
End Sub
Public Sub DISP()
'coding to display record in textbox
If Not (medrs.EOF = True Or medrs.BOF = True) Then
txtRedgNum.Text = medrs.Fields.It em("RedgNum")
txtComplnts.Tex t = medrs.Fields.It em("Complaints" ) ' on debug this is highlighted txtIllns.Text = medrs.Fields.It em("Illness")
txtPstIllns.Tex t = medrs.Fields.It em("PastIllness ")
txtDrgPresc.Tex t = medrs.Fields.It em("DrugPrescri bed")
End If
End Sub
Comment