Well, I'm making a hospital program, and I want to have a patient's list on the doctor's-edit screen.
So this what I wrote:
FrmAdd.Txtfirname.Text = frmWorker.AdoWorker.Recordset![WorkerFirName]
FrmAdd.txtlastname.Text = frmWorker.AdoWorker.Recordset![workerfamname]
FrmAdd.TxtWorkerHours.Text = frmWorker.AdoWorker.Recordset![workerhours]
FrmAdd.CmbWorkType.AddItem frmWorker.AdoWorker.Recordset![workertype]
Adopatients.RecordSource = "select * from TblPatient where DoctorId = " & Val(TxtId.Text)
Adopatients.Refresh
Well, it crashes after the adopatients.refresh line. Message "Syntex Error in From clause". So i looked in some SQL guides, and it looked ok. What am I doing wrong?
So this what I wrote:
FrmAdd.Txtfirname.Text = frmWorker.AdoWorker.Recordset![WorkerFirName]
FrmAdd.txtlastname.Text = frmWorker.AdoWorker.Recordset![workerfamname]
FrmAdd.TxtWorkerHours.Text = frmWorker.AdoWorker.Recordset![workerhours]
FrmAdd.CmbWorkType.AddItem frmWorker.AdoWorker.Recordset![workertype]
Adopatients.RecordSource = "select * from TblPatient where DoctorId = " & Val(TxtId.Text)
Adopatients.Refresh
Well, it crashes after the adopatients.refresh line. Message "Syntex Error in From clause". So i looked in some SQL guides, and it looked ok. What am I doing wrong?