K
Ken Hudson
Hi,
I have a db developed in Access 2003. On the main form (frmProjects) I have
an unbound object (txt_Ttl_Cost) the gets its data from a function call.
Public Function fnTtlEstLaborCost(X As Long) As Double
'Used on frmProjects to calculate total estimated labor cost.
Dim TtlEstLaborCost As Double
TtlEstLaborCost = Nz(DSum("[Hourly_Rate]*[Est_Labor_Hrs]", "tblLabor",
"[Proj_ID]=" & X),0)
fnTtlEstLaborCost = TtlEstLaborCost
End Function
The table referenced in the function (tblLabor) gets the Hourly_Rate and
Est_Labor_Hrs from a subform on the frmProjects. Whenever I add a new record
on the sub form, the txt_Ttl_Cost object updates automatically on the
frmProjects (the main form).
I have imported this db into Access 2007 and now the unbound object does not
update automatically. It updates when the form is closed and re-opened.
Is there something I need to do to get this to happen automatically? I can
code a requery event, but I was wondering why I don’t need to do this in 2003
and may need to in 2007?
I have a db developed in Access 2003. On the main form (frmProjects) I have
an unbound object (txt_Ttl_Cost) the gets its data from a function call.
Public Function fnTtlEstLaborCost(X As Long) As Double
'Used on frmProjects to calculate total estimated labor cost.
Dim TtlEstLaborCost As Double
TtlEstLaborCost = Nz(DSum("[Hourly_Rate]*[Est_Labor_Hrs]", "tblLabor",
"[Proj_ID]=" & X),0)
fnTtlEstLaborCost = TtlEstLaborCost
End Function
The table referenced in the function (tblLabor) gets the Hourly_Rate and
Est_Labor_Hrs from a subform on the frmProjects. Whenever I add a new record
on the sub form, the txt_Ttl_Cost object updates automatically on the
frmProjects (the main form).
I have imported this db into Access 2007 and now the unbound object does not
update automatically. It updates when the form is closed and re-opened.
Is there something I need to do to get this to happen automatically? I can
code a requery event, but I was wondering why I don’t need to do this in 2003
and may need to in 2007?