Hi folks,
I need some help here; I have 4 kitchens that use the same database to print their labels.
Each label contains customer name, location and date of meal.
The kitchen prints their labels at different times of the day; sometimes they will accidental hit the print button more than once!
To print their labels they select kitchen name from a combo box and enter a date.
I need the code to do the following;
Data Entered
• Kitchen name entered = A
• Date entered = 17/11/2014
Code
Check date field for kitchen A, if date already exists in table for kitchen A Then
'A date provided exists in the table
DoCmd.SetWarnings False
stDocName = "McrPrint_Customise_Labels"
DoCmd.RunMacro stDocName
Else
DoCmd.SetWarnings False
stDocName1 = "McrReOrderDietCusDate"
stDocName = "McrPrint_Customise_Labels"
DoCmd.RunMacro stDocName1
End If
End Sub
This is the code I have so far;
Private Sub Command38_Click()
If DCount("*", "QryPrintDataVBA", "[MealDate] = " & Format(txtCusDate, "\#mm\/dd\/yyyy\#") & _
" AND [Kitchen] = '" & Me.ComboSelectKitchen & "'") <> 0 Then
I need some help here; I have 4 kitchens that use the same database to print their labels.
Each label contains customer name, location and date of meal.
The kitchen prints their labels at different times of the day; sometimes they will accidental hit the print button more than once!
To print their labels they select kitchen name from a combo box and enter a date.
I need the code to do the following;
Data Entered
• Kitchen name entered = A
• Date entered = 17/11/2014
Code
Check date field for kitchen A, if date already exists in table for kitchen A Then
'A date provided exists in the table
DoCmd.SetWarnings False
stDocName = "McrPrint_Customise_Labels"
DoCmd.RunMacro stDocName
Else
DoCmd.SetWarnings False
stDocName1 = "McrReOrderDietCusDate"
stDocName = "McrPrint_Customise_Labels"
DoCmd.RunMacro stDocName1
End If
End Sub
This is the code I have so far;
Private Sub Command38_Click()
If DCount("*", "QryPrintDataVBA", "[MealDate] = " & Format(txtCusDate, "\#mm\/dd\/yyyy\#") & _
" AND [Kitchen] = '" & Me.ComboSelectKitchen & "'") <> 0 Then