In a parentform frmOrders with a subform sfrmOrders, it is easy to find out by code when we are on a new record ( = new order), by using Me.NewRecord.
But i also want to find out by code when we are on a new record (= an empty line in the subform to enter a new orderitem.
I tried the following code in the current event of the subform
if me.newrecord then
msgbox " We are on a new orderitem"
end if
but the result isn't what i expected.
Each time i enter an ordernumber in the parent form, the message shows up, even the fact that on this moment we aren't on a new orderitem! But when I navigate from an orderitem to the first control of a new orderitemline to fill in a new orderitem, no message appears!
I need to know that we are on a neworderitem, because this is a condition i use in the code to execute some function.
What to do to find out that we are on a new orderitem?
But i also want to find out by code when we are on a new record (= an empty line in the subform to enter a new orderitem.
I tried the following code in the current event of the subform
if me.newrecord then
msgbox " We are on a new orderitem"
end if
but the result isn't what i expected.
Each time i enter an ordernumber in the parent form, the message shows up, even the fact that on this moment we aren't on a new orderitem! But when I navigate from an orderitem to the first control of a new orderitemline to fill in a new orderitem, no message appears!
I need to know that we are on a neworderitem, because this is a condition i use in the code to execute some function.
What to do to find out that we are on a new orderitem?