Search results

  1. T

    Query Date range from form using VBA

    think i have got it. it wasnt the code or the sql that was wrong. where i am imporitng it from excel i had the table format for the prod date field as text. changed it to short date and now it returns the correct results. Thanks for your help ;-)
  2. T

    Query Date range from form using VBA

    no i cannot see what is wrong. this is why i posted on here. the sql in the query that is output from the code is SELECT Batches.* FROM Batches WHERE (([proddate] BETWEEN #11/04/2013# AND #11/06/2013#)); and i do not know what is wrong with it or why it doesnt return just records with those...
  3. T

    Query Date range from form using VBA

    Hi, it does the same as the original code. It seems to set the first date in the range but then ignores the end date so i get everything from the first date regardless of what i put in for the second.
  4. T

    Query Date range from form using VBA

    Hi, thanks for the speedy replies. remembered a similar issue i had when writing the last one and used the conjetdate thing but now this returns what first looked like just the records in taht date range but then also returned later dates. the code now looks liek this Private Sub...
  5. T

    Query Date range from form using VBA

    Hi, I have got a form where I have to textboxes for receiving the date. When a butotn is pressed I want the query to run that has the following SQL SELECT [Batches].* FROM [Batches]WHERE (([ProdDate] BETWEEN #01/11/2013# AND #08/11/2013#)); But it returns no results and i know there are...
  6. T

    Remove oldest duplicates

    hi, that did the trick thanks you. there was still an extra quotation mark but just tested it and it removed all of the entries of that filename before uploading it again which is perfect for what i need. Thansk for bearing with me and helping me out on this ;-) It is very much appreciated...
  7. T

    Remove oldest duplicates

    where do i post that sql code in? I dont mind how the entries are selected and deleted. which ever is easiest. i think your original idea of before an upload occurs of checking the database for entries already containing that filename getting deleted at that point will save having to search...
  8. T

    Remove oldest duplicates

    I am at a bit of a loss doing that. i do not know where to post the code in. would we need to do much to alter the code to look for every record in the database with that filename and delete it before the upload? Regards, Alan
  9. T

    Remove oldest duplicates

    Ok, I have added some quotes and moved the rs.open line till after the deletion criteria as i got a couple of different errors. It is now running ok but not actually deleting any records. i am just gettign all the new records added with none of the old ones being deleted first. my full...
  10. T

    Remove oldest duplicates

    i think the above problem occurs form it not understanding the code as an sql statement. maybe (flying blind here! lol) Changed it to this but now getting a different error about a missing operator Dim sql As String Dim fi As String fi = ActiveWorkbook.Name Dim DTE As String DTE = Now...
  11. T

    Remove oldest duplicates

    Hi, been looking into it some more and am thinking i want to add something like this but where it loops through all the records in the database first deleting everthing that matches the filename first. Dim fi As String fi = ActiveWorkbook.Name Dim DTE As String DTE = Now ' open a recordset...
  12. T

    Remove oldest duplicates

    the problem i have though is that the code i posted before is on the spreadsheet. it is part of a subroutine that e-mails the report out. They will not all be using the database as it is soemthing different i am trying out. I wanted to put the check for the duplicate entries on the opening...
  13. T

    Remove oldest duplicates

    cool. say for example i have a block of entries for filename 12-12-2013.xlsx upload time 12/12/2013 20:52 and anoher block of entries for filename 12-12-2013.xlsx upload time 13/12/2013 06:22 I need the macro to delete all the entries for 12/12/2013 20:52 Hope that covers it, regards, Alan
  14. T

    Remove oldest duplicates

    hi, the entries i need to keep are the ones with the later date and time. for example if someone runs the macro and sends a set of data to the database and it has the time of 12/12/2013 20:52. then someone runs it again the following morning and it has the time of 13/12/2013 08:12. then when...
  15. T

    Remove oldest duplicates

    Hi, thanks for all the replies. the code i have for exporting my data to a database is this Sub ExportToDB() Dim cn As ADODB.Connection, rs As ADODB.Recordset, row As Long Set cn = New ADODB.Connection cn.Open "Provider=Microsoft.ACE.OLEDB.12.0; " & _ "Data...
  16. T

    Remove oldest duplicates

    Hi, yes i want the earliest upload in. The entries i wish to have uploaded are on the attahced spreadsheet. any line in the spreadsheet that has no product entered in column D will not be written to the database. I have added a column in the code to enter the time it was uploaded so i have a...
  17. T

    Remove oldest duplicates

    Hi, I am writing an access database that will receive data from an excel spreadsheet when the user hits a button. THis button may be hit more than once and therefore duplicate records would be entered. What I want to do is write macro that will run when the database is opened that will...
  18. T

    Filter By Multiple Comboboxes on a form

    Hi, I have resolved the last question. I just changed the field type to Text in the database and then set the field validation to numeric only. Not the best wy but it works for me ;-)
  19. T

    Filter By Multiple Comboboxes on a form

    Hello everyone, new problem today. I have added a combo box for bin number to the report form. This is called cbobin. the sql statement comes out as SELECT [QC Tasting].* FROM [QC Tasting]WHERE (([Bin Number]='24')); but this throws a error 3464 type mismatch. Cant see why as this works fine...
  20. T

    Hardcoded Autofill

    Worked a treat. Brilliant. Thank you ;-)
Back
Top Bottom