Search results

  1. B

    Data validation

    Disregard last post it’s not that, I have added the following criteria into the query for date field (SELECT MAX(MealDate) from TblDietPlan) And Is Not Null This will only pull the most recent date which should eliminate all the hospital names apart from the most updated one. Therefore the...
  2. B

    Data validation

    Lol, thanks Namliam, I think I have figured it out! The code is working correctly, yes you read correctly lol When the code looks at the query QryPrintDataVBA It is looking to see if the date exists within the date field and if the hospital name exists within the hospital field i.e. The...
  3. B

    Data validation

    Hi Namliam, The (SELECT MAX(MealDate) from TblDietPlan) is not the problem, I can see why you would think this. I have removed this from the query and I am still receiving the same issue. I’m thinking I really only need a if statement like so; 'If Me.ComboSelectHospital = "hospital1" Then...
  4. B

    Data validation

    Thanks jdraw back to the drawing board I think, was kind of hoping for a quick fix...
  5. B

    Data validation

    The code should stop this from happening i.e. Does date and kitchen name exists within the database, if not re-order meals and print labels. If date and kitchen name exists within the database print labels no re-order
  6. B

    Data validation

    Thanks Jdraw and everyone for your help much appreciated, this is just so annoying
  7. B

    Data validation

    Hi folks, some additional information, I have removed all meal dates and client details. I have then added two new Clients that have their diets prepared in separate kitchens. Testing outcome Print labels for kitchen 1 with today’s date – works ok Print labels for kitchen 2 with...
  8. B

    Data validation

    Hi jdraw, I think we have our wires crossed, the labels are not the problem and the database design/relationship is not the problem. Regardless if the database is for a hospital, cafeteria setup or 1 menu per meal or 2 menu per meals or 1 table, 2 tables 1000 tables... This information is...
  9. B

    Data validation

    Hi a folk, the database is split, and my boss won’t allow me to upload a copy of the database argggggggggggg is there no way I can just modify the code so that if the name of the kitchen and date are in the table Then Print labels Else Re-order_diets Print labels At the current moment...
  10. B

    Data validation

    Hi Jdraw, The database just print labels, each labels tells the kitchen staff what food to put into each tray. I have included relationship picture and the code that's causing the problem. If DCount("*", "QryPrintDataVBA", "[MealDate] = " & Format(txtCusDate, "\#mm\/dd\/yyyy\#") & _ " AND...
  11. B

    Data validation

    Hi Namliam, yes you are spot on the cobo box for the kitchen is a lookup, any ideas how to resolve this as I have been pulling my hair out all day :/
  12. B

    Data validation

    ok no worries, thanks for your help
  13. B

    Data validation

    sorry the field name is called kitchen i.e. SELECT TblDietPlan.MealDate, TblKitchen.Kitchen FROM TblKitchen INNER JOIN TblDietPlan ON Tblkitchen.KitchenID = TblDietPlan.KitchenID;
  14. B

    Data validation

    I appreciate your help on this, I know the code is searching for date entered and the kitchen name, however if it finds the date already exists within the table regardless of the kitchen name the code is not running the second part of the else statement because that date already exists in the...
  15. B

    Data validation

    If DCount("*", "QryPrintDataVBA", "[MealDate] = " & Format(txtCusDate, "\#mm\/dd\/yyyy\#") & _ " AND [Kitchen] = '" & Me.ComboKitchenName & "'") <> 0 Then 'A date provided exists in the table DoCmd.SetWarnings False stDocName =...
  16. B

    Data validation

    The Dietplans table holds the meal details and the kitchen table holds the clients details, They are updated when the kitchen staff clicks on the print button; i.e. a query copies the diets data that has the most recent date then appends the data with the current date to the Dietplans table...
  17. B

    Data validation

    How do I modify the code to do the following? It Kitchen name and date already exist within the table do this Else If Kitchen name and date not in table do this What’s happen at the moment is; If date already in table regardless of kitchen name, the code will not re-order the meals for the...
  18. B

    Data validation

    Hi CJ_London, this is my sql for QryPrintDataVBA SELECT TblDietPlan.MealDate, TblKitchen.Name FROM TblKitchen INNER JOIN TblDietPlan ON Tblkitchen.KitchenID = TblDietPlan.KitchenID; The query displays all the dates and kitchen names...
  19. B

    Data validation

    The problem; If kitchen A prints the labels first and then kitchen B tyres to print, no data will come up for kitchen B as the code will look for the most recent date. This is 17/11/2014 as kitchen A has already printed their labels, labels for kitchen B will be blank hope this makes sense...
  20. B

    Data validation

    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...
Back
Top Bottom