Hi All
I have trawled through the forums and I think I'm just missing one small piece here.
I have a sub-form with a field (Numeric) called Treatment Number. Essentially what I want to happen here is that when a new treatment is added - the number increments from the last one e.g. the first treatment was 1, add a new treatment it's 2 etc for each individual patient. What I want it to do is locate what patient has been picked in the combo box and then match the increment to that.
I have added this to the control source for the Treatment Number field in my subform:
=DMax([tbl_Treatment_Details]![TreatmentNumber],"[TreatmentNumber]"," [txtPatientID] =" & [Forms]![MFrm_Patient_Details 01]![cboFindPatient])+1
[txtPatientID] is the name given to the PatientID on the main form
However when I enter this I get #Name? .
What am I doing wrong?
Thanks!
A
I have trawled through the forums and I think I'm just missing one small piece here.
I have a sub-form with a field (Numeric) called Treatment Number. Essentially what I want to happen here is that when a new treatment is added - the number increments from the last one e.g. the first treatment was 1, add a new treatment it's 2 etc for each individual patient. What I want it to do is locate what patient has been picked in the combo box and then match the increment to that.
I have added this to the control source for the Treatment Number field in my subform:
=DMax([tbl_Treatment_Details]![TreatmentNumber],"[TreatmentNumber]"," [txtPatientID] =" & [Forms]![MFrm_Patient_Details 01]![cboFindPatient])+1
[txtPatientID] is the name given to the PatientID on the main form
However when I enter this I get #Name? .
What am I doing wrong?
Thanks!
A