D
Dave Elliott
This code works , except that it still opens the FPayments form even when
there is no matching record, Why ???
Dim stDocName As String
Dim stLinkCriteria As String
Dim VarX As Variant
stDocName = "FPayments"
stLinkCriteria = "[Order ID]=" & Me![Order ID]
'VarX = DLookup("' & [Order ID] & '", "Orders", "[Order ID] Like
Forms![Edit Quote]![Order ID]")
VarX = DLookup("' & [Order ID] & '", "Orders", "[Order ID] =
Forms![Edit Quote]![Order ID]")
If IsNull(VarX) Then
MsgBox "No Payments Have Been Made"
Else: DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, Me.Name
End If
there is no matching record, Why ???
Dim stDocName As String
Dim stLinkCriteria As String
Dim VarX As Variant
stDocName = "FPayments"
stLinkCriteria = "[Order ID]=" & Me![Order ID]
'VarX = DLookup("' & [Order ID] & '", "Orders", "[Order ID] Like
Forms![Edit Quote]![Order ID]")
VarX = DLookup("' & [Order ID] & '", "Orders", "[Order ID] =
Forms![Edit Quote]![Order ID]")
If IsNull(VarX) Then
MsgBox "No Payments Have Been Made"
Else: DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, Me.Name
End If