Issue with Dlookup statment [closed]

安稳与你 提交于 2020-01-11 14:45:05

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!