J
John
How do I run code when entering a new record?
I have the following code in my form twice. Once in the Form_Current event
and again in the field "ResultMeasureID"_Lost focus event.
If Me!tbxMeasureYesNo = -1 Then
Me![tbxMeasureNumDesc].Visible = False
Me![tbxMeasureDenDesc].Visible = False
Me![ResultNum].Visible = False
Me![ResultDen].Visible = False
Me![tbxGoodTarget].Visible = False
Me![tbxResult].Visible = False
Me![ResultYesNo].Visible = True
Else
Me![tbxMeasureNumDesc].Visible = True
Me![tbxMeasureDenDesc].Visible = True
Me![ResultNum].Visible = True
Me![ResultDen].Visible = True
Me![tbxGoodTarget].Visible = True
Me![tbxResult].Visible = True
Me![ResultYesNo].Visible = False
End If
Know that the field "tbxMeasureYesNo" is being automatically populated once
the ResultMeasureID field is populated with an existing current measure
number.
The code above basically sets numerator and denominator fields visible or
not based on their applicability to a particular measure (e.g. if a measure
is yes/no, there is no need for numerator and denominator fields).
It works fine when I open the form and cycle through all the records, but
does not work when I add a new results record. I need it to run after
entering data in the ResultMeasureID field.
I have the following code in my form twice. Once in the Form_Current event
and again in the field "ResultMeasureID"_Lost focus event.
If Me!tbxMeasureYesNo = -1 Then
Me![tbxMeasureNumDesc].Visible = False
Me![tbxMeasureDenDesc].Visible = False
Me![ResultNum].Visible = False
Me![ResultDen].Visible = False
Me![tbxGoodTarget].Visible = False
Me![tbxResult].Visible = False
Me![ResultYesNo].Visible = True
Else
Me![tbxMeasureNumDesc].Visible = True
Me![tbxMeasureDenDesc].Visible = True
Me![ResultNum].Visible = True
Me![ResultDen].Visible = True
Me![tbxGoodTarget].Visible = True
Me![tbxResult].Visible = True
Me![ResultYesNo].Visible = False
End If
Know that the field "tbxMeasureYesNo" is being automatically populated once
the ResultMeasureID field is populated with an existing current measure
number.
The code above basically sets numerator and denominator fields visible or
not based on their applicability to a particular measure (e.g. if a measure
is yes/no, there is no need for numerator and denominator fields).
It works fine when I open the form and cycle through all the records, but
does not work when I add a new results record. I need it to run after
entering data in the ResultMeasureID field.