Search results

  1. J

    Query SQL to VBA code for use as a recordset

    any help on the above any one!?! I need to add in the WHERE below: WHERE (((Transactions.Asset)=[Forms]![Reserve]![Asset])) Into the strSQL. There are a number of ANDs and OR's so i just cant get the brackets correct. I think there needs to be 3 of the above in the statement below one for...
  2. J

    Query SQL to VBA code for use as a recordset

    in case you are wondering the full code for the Populate Calendar sub is: Private Sub PopulateCalendar() On Error GoTo Err_PopulateCalendar Dim strFirstOfMonth As String, bytFirstWeekdayOfMonth As Byte, bytBlockCounter As Byte Dim bytBlockDayOfMonth As Byte, lngBlockDate As Long, ctlDayBlock As...
  3. J

    Query SQL to VBA code for use as a recordset

    I am form the UK so time is the same mate. I have tried everything and have come up with nothing that works. The union query works fine and shows me the records i need but cant seem to get it to work in VBA form. I have also been looking at it from a different angle which may be easier as i...
  4. J

    Query SQL to VBA code for use as a recordset

    hi ridders....i have added your new code and still get a compile error now it goes to the 3rd "dd/mm/yyyy")) on the second ")"
  5. J

    Query SQL to VBA code for use as a recordset

    i changed the "dd/mm/yyyy" to 'dd/mm/yyyy' on all of these in the code and it now gives an Error Too few parameters. 1 Expected
  6. J

    Query SQL to VBA code for use as a recordset

    Hi Colin, thank you very much...i put the code you gave me in the VBA (see below) and it highlights it all in red and gives the error below: Compile Error: Expected end of statement and highlights the first "dd" in the code Any thoughts....... strSql = "SELECT Reservations.[Job Number]...
  7. J

    Query SQL to VBA code for use as a recordset

    Thanks Hans.....I will give this ago and see if it works. If anyone can post the vba code of my SQL above in the meantime that would be great!!! :banghead:
  8. J

    Query SQL to VBA code for use as a recordset

    I need it in VBA code form as it will make part of a much larger code sequence.
  9. J

    Query SQL to VBA code for use as a recordset

    Hi I have formulated a UNION query to give me a result set which is filtered using a the Asset field on a form called Reserve. I need to put the dates into "dd/mm/yyyy" format as some are Date & Time hence the format parts. I am not great at converting query SQl to VBA code......can anyone let...
  10. J

    VBA Code Type MisMatch.....Where is it!?! HELP

    The table fields are date format, the sql is running off a query which I have created to get me my initial recordset. Then the code should create the mini record set that I want to show on the calendar so just the Jon number and Initials and then the start and end date of the record to out that...
  11. J

    VBA Code Type MisMatch.....Where is it!?! HELP

    i have put the strSQL code into a new query and saved it....opened the form (as it needs the ID on the form to filter the correct records) and it shows what i would expect. The recordset shows the Job Number, Initials (of the person), Check Out Date and Due Date of the reservations that are in...
  12. J

    VBA Code Type MisMatch.....Where is it!?! HELP

    i am now getting an error that says "Too few parameters, Expected 1" I put a stop on the PopulateCalendar sub and F8'd to follow it through and it runs through highlighting everything ok and then after highlighting "Set rstEvents = db.OpenRecordset(strSQL)" jumps to the error. I put a...
  13. J

    VBA Code Type MisMatch.....Where is it!?! HELP

    yes i have changed that back to: strFirstOfMonth = Str(intMonth) & "/1/" & Str(intYear)
  14. J

    VBA Code Type MisMatch.....Where is it!?! HELP

    Objcirrentdate is dim at the top of the code page for the form (not shown there) and is used to store the current date I believe. the intmonth and intyear are created in a public sub in a seperate module
  15. J

    VBA Code Type MisMatch.....Where is it!?! HELP

    not sure what you mean
  16. J

    VBA Code Type MisMatch.....Where is it!?! HELP

    probably is but i cant determine where it is........i copied it into the query SQL but there is that many &'s in it i cant make head nor tail of it I am hoping someone can look at it and correct the issue
  17. J

    VBA Code Type MisMatch.....Where is it!?! HELP

    Hi all HELP WANTED!!!! I have the code below which is to populate a calender fromat on a form called reserve. When the PopulateCalendar sub is called i get a Type Mismatch.....can anyone find the issue / location of the Mismatch for me...... Private Sub PopulateCalendar() On Error GoTo...
  18. J

    Validation from multiple records

    Yes i am good with the Date() function but not sure on the code to get it to set the field in the form to Date() for [Checked Out Date] and Date()+7 for [Due Date] (which are their defaults) effectively if the If rs.RecordCount <> 0 Then is true i want to cancel the operation clear / reset the...
  19. J

    Validation from multiple records

    Galax, you are a LEGEND !!! Works well now. Now i just need it to set reset the [Check Out Date] to today and the [Due Date] to today +7 if the recordset empty, i have this up to now which i think works to this point, What do i need to do to reset the dates: Set db = CurrentDb Set rs =...
  20. J

    Validation from multiple records

    hi Galax, When i replace your code add my code with yours it changes the " to "" at the end of the first line?
Back
Top Bottom