My form (SM Developer-ShiftlyPM) has a record source (SM Developer-Shiftly PM Log Query) which is a query. I want to look up a value from a different query (SM Developer-pH Chart Query) to calculate the value for SMD-pHMovingRange below. How can I change the DoCmd code to go to the last record in a different query?
Dim a, b As Variant
DoCmd.GoToRecord , , acLast
a = DLookup("[SMD-pH Lab]", "SM Developer-pH Chart Query")
DoCmd.GoToRecord , , acPrevious
b = DLookup("[SMD-pH Lab]", "SM Developer-pH Chart Query")
Me.SMD_pHMovingRange = Abs(b - a)
Dim a, b As Variant
DoCmd.GoToRecord , , acLast
a = DLookup("[SMD-pH Lab]", "SM Developer-pH Chart Query")
DoCmd.GoToRecord , , acPrevious
b = DLookup("[SMD-pH Lab]", "SM Developer-pH Chart Query")
Me.SMD_pHMovingRange = Abs(b - a)