Search results

  1. K

    Getting Max from SELECT Query

    Hi Just realised I didn't post back on here about this... namliam, had to change the reference to 'x' at the end to be the route count, but other than that it was perfect. sql = "SELECT Max(RouteCount.CountOfROUTE) AS MaxRoutes " & _ "FROM ( " & _ "SELECT...
  2. K

    Getting Max from SELECT Query

    Hi I currently have 2 queries.. Query 1 select statement getting count of field Query 2 getting max of Query 1 Instead of the queries I want to do this in vba with a recordset ' Select from first query sql = "SELECT tblOriginal.ROUTE, Count(tblOriginal.ROUTE) AS CountOfROUTE " & _...
  3. K

    Create a Join using LEFT string manipulation

    Hi Just thought I'd share another way a colleague suggested doing this... Achieves the same result but seems be tidier. In Table1 I've created a calculated field NEWFIELD: LEFT(Field,6) and then in Query1 Join the NEWFIELD with the Field in Table2 SELECT Table2.ORDDETTYPE...
  4. K

    Create a Join using LEFT string manipulation

    Hi I think I know the answer but want to check. I've been asked to create a query, without querying a query first, but it's the only way I know. I have two tables Table1 will have data in a column that is 9 characters long ULCABC123 ULCABC124 ULCABC125 PLTABC123 PLTABC124 Table2 will have...
  5. K

    DAO OpenDatabase accdb file - Not a valid password

    Excellent... Thank you. Thats sorted it.
  6. K

    DAO OpenDatabase accdb file - Not a valid password

    Hi Yes password is correct and opens fine manually The database has been converted to 2013 format. (accdb)
  7. K

    DAO OpenDatabase accdb file - Not a valid password

    BUMP! Can anyone help with this please?
  8. K

    DAO OpenDatabase accdb file - Not a valid password

    Hi I thought I had this working but it isn't working when I have a password on the database The password is correct as I can open it manually I'm getting the error message "Not a valid password" Dim wrkspc As DAO.Workspace Set wrkspc = DBEngine(0) Set db =...
  9. K

    DAO OpenDatabase accdb file - Not a valid password

    Hi I've found the solution in this link here http://answers.microsoft.com/en-us/office/forum/office_2010-access/use-dao-to-open-a-password-protected-access-2010/7193f26f-a275-e011-8dfc-68b599b31bf5 Here is the solution, I just needed to add the workspace. Dim wrkspc As DAO.Workspace...
  10. K

    DAO OpenDatabase accdb file - Not a valid password

    Hi I've change my db to a accdb file and in my Excel (xlsm) file I am trying to use the open database (DAO method) I've changed the reference to: Microsoft Office 15.0 Access database engine It was working fine until I added a password to the database Here is the code: Set db =...
  11. K

    Customise Access icon in Windows 7 taskbar

    Hi Is this supposed to work with Win 7 and Access 2010 :banghead: In answer to my own question, yes it does... Although, it didn't work until I closed on reopened access. Thanks for code Nigel
  12. K

    Hide Main DB window - only show form - ACCESS 2010

    Hi I'm using the code to hide the access window which is all great for the user point of view. However, when I restore it with this... fSetAccessWindow(SW_SHOWMAXIMIZED) I don't get any of the toolbars/ribbon back until I close and reopen access. Its not a major one, just an inconvenience...
  13. K

    Class Event for Multiple Controls

    This is excellent... so clean and efficient. Thanks for taking the time to help with this. A massive help and I'm sure lots of people will find it useful. Thanks again Kev :D :D :D
  14. K

    Class Event for Multiple Controls

    Hi, good tip... The annoying this was I was sure I asked a question about it a couple of years about it but couldn't find anything..
  15. K

    Class Event for Multiple Controls

    Hi Chris Thanks for this.. I've got that working now...:):cool: Last question on this I think. I wanted reduce the amount of times the event is called and prevent unnecessary updating of controls. In the section detail I've sorted it (I think this is the right way) Private Sub...
  16. K

    Class Event for Multiple Controls

    Hi I had tried to pass the form directly into the class and I created a new property UsrFrm which in my post above. So I pass it into the class like this Set newCmd = New clsEvents Set newCmd.UsrFrm = Me col.Add newCmd, Me.Name and in the class ive done this Public Property Set...
  17. K

    Retrieve field properties DAO recordset

    Hi, sorry for not getting back to you on this sooner... although it was messy I had bigger fish to fry... Anyway, just wanted to say thanks to you both for this. Perfect solution. :):):)
  18. K

    Retrieve field properties DAO recordset

    :)Ha, I did say it didn't feel right...:)
  19. K

    Class Event for Multiple Controls

    Hi I've got this code (which I can't remember where from now, but I don't claim to have done it). Basically I have a class event that works for all controls on any userform. Its all working fine but I can't add an event to trap the click or mouse move of the userform itself. Basically so...
  20. K

    Retrieve field properties DAO recordset

    I've kind of got round it but it doesn't feel right to do it like this... Basically, changed the name of the field to include a "%" symbol and the use instr to determine the existence of the percentage symbol. If InStr(1, rs.Fields(y).Name, "%") > 0 Then r.NumberFormat = "0.00%" Any better ideas?
Back
Top Bottom