THis is probably a simple question but I cant seem to get everything coordinated.
I have a form that collects information about participant's in a study including height, weight etc.
I need to automatically calculate BMI once a person has placed the information in to the form so I created a query and used =DLookUp("[BMICalculation]","qryBMICalculation","[ParticipantID]= Form![ParticipantID]") in an unbound field called BMI and then placed Me.Requery in the after update event of the height and weight fields.
The query works beautifully if I try to update existing data but I get a error re:
Me.Requery when I am adding new participant details because all the fields in the form are set as required and it sets off some error.
How do I make sure that all changes are updated but can still add in new records?
I tried If is not null 9ParticipantHeight) then Me.Requery in the after update event of Participant weight and vice versa but this didnt work either - it works well when updating records but not when adding new data - it sets off the error.
Basically I :
1. Just want to calculate a person's BMI straight away (without having to close and reopen) using fields in the same form - don't care is by dlookup or not
2. Have this updated if I ever change anything in these fields in the form.
3. I cant assume that the person entering the data will do weight first or vice versa and that once they enter the data they will not try to change it.
I have a form that collects information about participant's in a study including height, weight etc.
I need to automatically calculate BMI once a person has placed the information in to the form so I created a query and used =DLookUp("[BMICalculation]","qryBMICalculation","[ParticipantID]= Form![ParticipantID]") in an unbound field called BMI and then placed Me.Requery in the after update event of the height and weight fields.
The query works beautifully if I try to update existing data but I get a error re:
Me.Requery when I am adding new participant details because all the fields in the form are set as required and it sets off some error.
How do I make sure that all changes are updated but can still add in new records?
I tried If is not null 9ParticipantHeight) then Me.Requery in the after update event of Participant weight and vice versa but this didnt work either - it works well when updating records but not when adding new data - it sets off the error.
Basically I :
1. Just want to calculate a person's BMI straight away (without having to close and reopen) using fields in the same form - don't care is by dlookup or not
2. Have this updated if I ever change anything in these fields in the form.
3. I cant assume that the person entering the data will do weight first or vice versa and that once they enter the data they will not try to change it.