问题
Private Sub WeightFrom_BeforeUpdate(Cancel As Integer)
DLookup("Regimen", "AdminTableRegimenPerWeight"," & [FrmAdminRegimen].Form![WeightFrom] &" Between [WeightTo] And [WeightFrom]") Then
MsgBox "Weight already assigned!"
Me.WeightTo = Null
End If
End Sub
Error is showing with the above Dlook code.
I have a table in which I assign particular dosage based on patient's weight. So if a patient weight lies between 33 to 50 then I prescibe certain amount of dosage value for that Medicine. So there are total of around 15 Medicines. What I want to do is when assigning medicine I want the system to check if the weight values for that medicine does not lie between any previous weights for that particular medicine. Something like BeforeUpdate : Dlookup Medicine Weight inbetween Suppose :
Regimen_________ WeightFrom__________WeightTo__________Dosage_______Unit
A_____________________33_______________55______________450__________mg
B_____________________56_______________77______________500__________mg
来源:https://stackoverflow.com/questions/59610295/issue-with-dlookup-statment