Search results

  1. B

    Select Query - The Most Recent Date

    How would you write a Select Query to select the most recent dates? Select OrderDates From Orders Where >=Date() No good if recent date is older than todays date!!!!!!!!!!!!!!!
  2. B

    UpDate Query Agrrrrrrrrrrr

    Hi, yep trying to update all records with the same date, the query works ok but doesn’t add the new date field, its blank. I have managed to solve this issue by creating a table first then append the data from the table.
  3. B

    UpDate Query Agrrrrrrrrrrr

    Hi folks, why is this update query not working, I'm trying to update a date field stored in a table. The new date is passed from a txtbox on a form to the update query!!! SQL code UPDATE TblDietPlantemp SET TblDietPlantemp.MealDate = [Forms]![FrmSwitchBoard]![txtCusDate];
  4. B

    Validation

    Hi pbaldy, I’m confused too lol, Basically if DLookup returns today’s date the order has been placed, if not then the code will run the macro that will place the order in the order table, it’s unique to this setup!!! The code should do the following; If ReturnValue is not equal today Date...
  5. B

    Validation

    Hi Folks, need some help here, not sure if my code is correct, I’m trying to validate some values when a Form is opened i.e. If ReturnValue is not equal today Date -1 OR ReturnValue is not equal to today Date Then run the following Marco Private Sub Form_Load() ReturnValue =...
  6. B

    Append Query

    Thanks Paul, much appreciated
  7. B

    Append Query

    I am trying to append data to a table with a date from a textbox on a form and have the append query increment the date field by 1 day i.e. DateAdd("d",1,Date()) INSERT INTO TblDietPlan ( ClientID, MealDate, MorningSnack, AfternoonSnack, EveningSnack ) SELECT DISTINCT TblDietPlan.ClientID...
  8. B

    Append Query

    Hi folks, how do you take a date from a textbox on a form into an Append query and increase the date entered into the textbox by 1 day. i.e. 26/11/2013 to append the date as 27/11/2013 This is what I have so far but not working?? Append Query MealDate...
  9. B

    D Loop Not working

    Hi, could someone point out where I'm going wrong with this loop, trying to run Update query number of times, is this possible?? Private Sub Command38_Click() Dim startDate As Date, endDate As Date Dim tempvalue As Long, dayCtr As Long startDate = InputBox("Enter the Start Date")...
  10. B

    Validation Code

    Hi Paul/folks can you help me with this, I need a piece of code that will ask for the Start date and End date, The code will then run an update query that amount of time i.e. If StartDate 25/11/2013 EndDate 30/11/2013, The code will run the update Query 5 times and will also increment the...
  11. B

    Validation Code

    Good morning Paul, thanks for your help again, just working through your code, well trying to get my head round it,lol.
  12. B

    Validation Code

    Hi Folks, looking for some advice, I have a form with a textbox start date and a textbox end date, I would like to run some code that will check the date field within a table, if no dates within this range then run macro i.e. StartDate 19/11/2013 EndDate 22/11/2013 If 19/11/2013 OR...
  13. B

    Validation Code

    Hi folks, need some help with this code, not really sure what's wrong with it!!! Private Sub Command29_Click() If DCount("*", "TblReOrderDate", "[ReOrderDate] = "Date()" <> 0 Then Cancel MsgBox "The date is not valid, enter a new date and try again..", vbCritical Me.[Mealdate] = vbNullString...
  14. B

    Validation Code

    :)Thanks Paul, i need to study your code, i really need to get my head round VBA, any good books/sites you would recommend.
  15. B

    Validation Code

    This is what I have so far... Private Sub Command29_Click () On Error GoTo Err_Command29_Click If DLookUp("[ReOrderDate]" = "date() + 1", Then Cancel Else DoCmd.RunMacro stDocName End If Err_Command29_Click: MsgBox Err.Description Resume Exit_Command29_Click End Sub
  16. B

    Validation Code

    Hi folks, need some help with validation code!! The validation code will be embedded into a command button, when pressed the code will check a date field within a table, if it has tomorrows date it will not update the table!! I need something like this I think?? Private Sub...
  17. B

    Append Query

    Thanks Pual, Got it to work :)
  18. B

    Append Query

    Hi Paul, I’ve tried the following: Expr1: [MealDate]=DateAdd("d",1,Date()) Outcome Record I wish to append to my table Name: Joe Smith MealDate: 07/11/2013 After the Append query is ran Name: Joe Smith...
  19. B

    Append Query

    Hi Paul, yes I would like to append a records to my table with the date field incremented by 1 i.e. Record I wish to append to my table Name: Joe Smith MealDate: 07/11/2012 How I would like the record to be appended to my table Name: Joe Smith MealDate: 08/11/2012
  20. B

    Append Query

    Hi Folks, is possible to run an Append Query and update a field at the sametime? i.e. I would like the MealDate field to be incremented by 1, just not sure how to write the code within the query!!! This is what I have so far!!! not working MealDate: ([MealDate](Date()+1)) :confused:
Back
Top Bottom