Hi folks, need some help please, trying to pass a date field from a Form and check if this date already exists within a table if so run this macro.
This is what I have so far...
Private Sub Command38_Click()
If DCount("*", "TblDietPlan", "[MealDate] = <> txtCusDate Then
stDocName = "McrPrint_LabelsWklyCR"
DoCmd.RunMacro stDocName
Else
stDocName1 = "McrReOrderDietCusDate"
DoCmd.RunMacro stDocName1
stDocName2 = "McrPrint_LabelsWklyCR"
DoCmd.RunMacro stDocName2
End If
End Sub
This is what I have so far...
Private Sub Command38_Click()
If DCount("*", "TblDietPlan", "[MealDate] = <> txtCusDate Then
stDocName = "McrPrint_LabelsWklyCR"
DoCmd.RunMacro stDocName
Else
stDocName1 = "McrReOrderDietCusDate"
DoCmd.RunMacro stDocName1
stDocName2 = "McrPrint_LabelsWklyCR"
DoCmd.RunMacro stDocName2
End If
End Sub