The code below will not open the correct record- that is, the record that matches the tracking number.
It runs agains the very tracking number instead.
If I put this code on a button and run it after the record loads it works correctly.
Help with the code, and a little VBA lesson, please?
DoCmd.OpenForm "frmClaimAllowanceDrillDown", acNormal, , "[TrackingNumber]=" & Forms!frmlocalrecords!TrackingNumber
Pause (3)
If Forms!frmclaimallowancedrilldown!Changed = -1 Then
cmdClaimAllowance.ForeColor = vbRed
Else
cmdClaimAllowance.ForeColor = vbBlack
End If
DoCmd.Close acForm, "frmClaimAllowanceDrillDown", acSaveNo
Thanks,
Dave
It runs agains the very tracking number instead.
If I put this code on a button and run it after the record loads it works correctly.
Help with the code, and a little VBA lesson, please?
DoCmd.OpenForm "frmClaimAllowanceDrillDown", acNormal, , "[TrackingNumber]=" & Forms!frmlocalrecords!TrackingNumber
Pause (3)
If Forms!frmclaimallowancedrilldown!Changed = -1 Then
cmdClaimAllowance.ForeColor = vbRed
Else
cmdClaimAllowance.ForeColor = vbBlack
End If
DoCmd.Close acForm, "frmClaimAllowanceDrillDown", acSaveNo
Thanks,
Dave