Since you want to open a form from the control, I changed the event to the double click event.
And I don't like negative logic (NOT IsNull() ), so I changed the order of the IF() test.
Try this:
Code:
Option Compare Database '<<-- should be at top of EVERY Module
Option Explicit '<<-- should be at top of EVERY Module
Private Sub InvTotal_DblClick(Cancel As Integer)
Const DataForm As String = "TransactionF"
'#############################
'for debugging - comment out/delete the following line after debugging
MsgBox "InvTotal = " & Nz(Me.InvTotal, "NULL") & "; InvoiceID = " & Nz(Me.InvoiceID, "NULL")
'#############################
If IsNull(Me.InvTotal) Then
MsgBox "Oops"
'DoCmd.OpenForm DataForm
'DoCmd.GoToRecord , , acNewRec
Else
DoCmd.OpenForm DataForm, WhereCondition:="[InvoiceID]=" & Me.InvoiceID
End If
End Sub