Search results

  1. G

    Lock all edits whilst query is running ?

    Sorry, queries. I think of it as 3 passes of SELECT on the same table, one after the other. 3 queries plus a union.
  2. G

    Lock all edits whilst query is running ?

    Well, my records are timestamped for edit time but it won't work. The key thing here, isn't so much that it's a few minutes out of date, but that it's not consistent with itself. If a record has 100 net and 20 VAT, I need to fetch those values on all 3 passes for it to be consistent. If I...
  3. G

    Lock all edits whilst query is running ?

    Hi, Thanks, yes you are right, if we edit after the result is run then it's out of date. But, at the moment of getting the result, I need it to be consistent (if possible, or I would have to have a caveat about possible invalid results. This is an on-the-fly result, if you like). Each...
  4. G

    Lock all edits whilst query is running ?

    I've got a form view which takes a second or two to populate and has to make three passes on the same table to get a result. I need to lock out all users for the period that the union query is running or the result may not be valid. I could read data in Pass 1 and if a user then edits...
  5. G

    Solved Customize Search Box

    Is this what you're after ? .FindFirst " [FieldName] = " & Me.cboStatus & " AND EmployeeID = " & nz(me.txtSearchBox,0) Where FieldName if the table column name in your Employee table.
  6. G

    Solved Customize Search Box

    Of course my bad you need to put the table field name !
  7. G

    Solved Customize Search Box

    I think DBguy mean to replace 'Status' with the name of your control. If you're only ever interested in status 1 or 2 you could try: if EmployeeID is text: .FindFirst "( Me.cboStatus = 1 OR Me.cboStatus = 2 ) AND EmployeeID = '" & me.txtSearchBox & "'" if EmployeeID is numeric: .FindFirst...
  8. G

    get the numeric part of a string

    This is where I would start (this isn't code but gives you an idea) dim varStrArray as variant ' gets you a 1-dimensional array varStrArray = split (string(1),":") ' string(1) = eg "1. open": "125.2500" string part = varStrArray(0) ' eg "1. open" number part =...
  9. G

    Solved Have subforms last record focused

    I do it with a MoveLast command. But, you will get returned to the first record if you call any of the edit commands afterwards, like AllowEdits, more information here: https://www.fmsinc.com/free/NewTips/Access/ResyncSubform.asp
  10. G

    Unbound Multi User DAO Recordset locking

    OK, caveat, I'm not a software or Access professional, in fact I'm not much beyond beginner. I don't think it makes any difference whether my recordset is bound or unbound. I handle the locks and the ability to edit it in code. Here's how I handle record locking. I've tested it by, as you...
  11. G

    Solved Focus on form open via VBA

    Yes, it was that. .SetFocus after hiding. Thank you.
  12. G

    Solved Focus on form open via VBA

    I have a login form which opens to the user name field which is what I want. On login, it opens a menu form and closes itself. When we log out, it opens the login form and the menu form hides. But on subsequent opens the focus goes to the Access object list. I have to click in the user name...
  13. G

    Organisation for Queries

    Thanks all, some good tips there which will enhance my organisation. Always good to hear how others are doing stuff. On the related subject of readable code, I find that if I review my comments some time after I wrote them, I realise I need to make things clearer (including, for myself)
  14. G

    Organisation for Queries

    Just wondering .. how do you organise your queries ? Naming conventions ? Main vs. sub ? After a form ? Now I have more than a handful of saved queries I'm feeling the need for some kind of method of knowing how each one is used. There's nowhere to save a narrative about the query, unless I...
  15. G

    Best way to disallow special characters in a field

    I don't think I ever tested or used this but I remembered bookmarking it just in case https://www.utteraccess.com/forum/index.php?showtopic=779199
  16. G

    Join Table on Expression ?

    Indulge me a bit more as I find this an interesting conundrum. If you feel this discussion is extending a bit please migrate it to Theory and Practice. I still have duplicated data in my table so I'm not committed either way yet. I'm storing my year and period, not as two text pieces but as a...
  17. G

    Join Table on Expression ?

    Oops I said PrdNamesID is AutoNumber, it is long but it's a number from 1 to 53 and as the PK it's indexed of course. I have got it working in the existing query along the lines suggested by pisorisaac and CJ_London like this: (SELECT PrdName FROM tblPrdNames WHERE tblPrdNames.PrdNameID =...
  18. G

    Join Table on Expression ?

    ? vartype(202006 mod 100) 3 3 is long so matches the joined field but Access isn't happy with it.
  19. G

    Join Table on Expression ?

    Alternatively, if I should keep the fields separate, and lose the 'combined' field what would the function be to select the range ? I'll admit I thought that 'between' 2 longs in the query was likely to give the best performance. I only have to combine them once but the query would have to...
  20. G

    Join Table on Expression ?

    I pondered over #3 (thank you) but I thought I had that covered, the MOD function presumably returns a numeric, the field I want to join is AutoNumber. Is there another way I could try it?
Back
Top Bottom