Search results

  1. J

    delete 4 out of 5 records where name field and address field repeat more than 5x

    I gave you two queries. The second query was for deleting the records you wish to eliminate. I guess that approach isn't what you want. I can do what you ask, maybe later on tonight.
  2. J

    delete 4 out of 5 records where name field and address field repeat more than 5x

    The code I gave you works fine. Attached is a sample. When you run the code (qryFindDups) it should insert two records into KeepThese. It does.
  3. J

    Adjusting SQL to accommodate apostrophe

    Best advice - learn to user parameters !!! Then you won't have to worry about pound signs and apostrophes anymore.
  4. J

    Adjusting SQL to accommodate apostrophe

    I use parameters to avoid all these issues. But if you insist on doing things the hard way, here's a couple of pointers: - Dates have to be in pound signs #01/01/1905# - You can't have a period before a WHERE clause ". WHERE ....
  5. J

    Search and update form field query (i think)

    There may be some syntax errors there - it' s untested.
  6. J

    Search and update form field query (i think)

    You're wasting your time trying to bring your saved query into VBA. (Generally this is practical only if you don't need to add further criteria or parameters). So do something like this. Code: Private Sub Form_Current() Dim rs As DAO.Recordset Dim qdf As DAO.QueryDef set qdf =...
  7. J

    DoCmd.RunSQL strSQL - Slowly killing my brain

    Also, I asked you to output your SQL into this forum using a MsgBox (see above).
  8. J

    DoCmd.RunSQL strSQL - Slowly killing my brain

    Did you get rid of the keyword table as I suggested? INSERT INTO Table![Merchant CCF]([Merchant
  9. J

    DoCmd.RunSQL strSQL - Slowly killing my brain

    Also this line: " FROM Table![Main table]" probably should be: " FROM [Main table] " because VBA doesn't know all of the Access jargon (and thus doesn't use the keyword "table").
  10. J

    DoCmd.RunSQL strSQL - Slowly killing my brain

    You can use MsgBox strSQL to output your actual SQL and use control C to copy and paste it form the Msgbox into this forum. You probably need " WHERE [Main table].ID BETWEEN 1 AND 5000 "
  11. J

    Error In From Clause

    Turns out I managed to reproduce the error. Apparently ADO doesn't like you using a WHERE clause with your "AdCmdTable" - I'm guessing you have to select the whole table to use adCmdTable.
  12. J

    invalid procedure call...

    In my notebook I recorded getting that same error on the MID function because I was starting at an invalid point in the string. I believe the first char is at position 1 whereas I tried to start at position zero. Probably the same idea here - Your LEFT function is probably starting illegally...
  13. J

    ComboBox Requery doesn't Work

    I don't see where you've indicated what event you are using. All you told us was: Private Sub ClearcboEmployee()...... but in what event is this code being called?
  14. J

    help counting distinct values

    The following is untested (and probably has more joins than necessary) SELECT NumPlacings.*, NumOfTournaments FROM ( SELECT Player.Player_ID AS ID, (Player_lname + ", " + Player_fname) AS NAME, COUNT(Placing_ID) AS numOfPlacings FROM Player, Representative, Contestant, Placing WHERE...
  15. J

    delete 4 out of 5 records where name field and address field repeat more than 5x

    I know what's causing the circular reference. Try this (see changes in red). But I still haven't tested it so there may be more errors. INSERT INTO KeepThese (ID) SELECT ID FROM ( SELECT Min(P.ID) AS ID FROM Print_Ready as P GROUP BY names_1, addresses HAVING COUNT(*) >=5 UNION ALL SELECT ID...
  16. J

    help counting distinct values

    I think the basic idea to get the number of tournaments is the following (possibly with more joins than needed): SELECT PlayerID, COUNT(Tournament_ID) AS numOfTournaments FROM ( SELECT DISTINCT Player.PlayerID, tournament_ID FROM Player, Representative, Contestant, Placing WHERE...
  17. J

    help counting distinct values

    Would be helpful if I knew which table to pull the number of tournaments from (otherwise I'll end up joining more tables than necessary).
  18. J

    help counting distinct values

    You seem to be suggesting that a single player can have the same tournamentID appear multiple times in the table TournamentID.....Placing 1..........................4 1..........................3 1..........................1 In that case you will probably need to group by TournamentID as to...
  19. J

    Combobox that simulates TreeView question

    mpant, You say it's a question of space. I agree that a cbo is designed to minimize space - but let's consider how it does that. A cbo is about the size of a button. When the user clicks this "button" (so to speak), it drops down (i.e. expands) to a larger size. So we start with something...
  20. J

    Using Access to Search folders

    If you install Microsoft's Windows Desktop Search (free), you can point it to your PDF folder. I'm guessing you already knew this, and you need something more customized. As far as I know, there are free tools on the Web for extracting text from PDF files using VBA. And presumably you can use...
Back
Top Bottom