Search results

  1. E

    Extracting varying length string between two characters

    Isn't that additional work that overshadows the actual effort of query execution? => TakeStartTime Set rs = db.Openrecordset(SqlStatement, dbOpenForwardOnly) rs.MoveLast => TakeEndTime For a clean measurement, I would also expect that each compound expression is unique, i.e. occurs only once in...
  2. E

    Extracting varying length string between two characters

    I would like to see the complete test environment. If you do exactly the same thing and just add some overhead, you shouldn't be surprised if runtimes increase. This conclusion seems plausible to me even without testing. The Expression Service only works if the query is started from Access...
  3. E

    Extracting varying length string between two characters

    Mid, Instr and other functions are not part of Jet-SQL, but are made available via the so-called Expression Service. Therefore, VBA functions, Access functions (Nz, DCount) and self-defined functions can be integrated into queries. If you do not notice such a transfer and the associated...
  4. E

    Extracting varying length string between two characters

    Don't worry. I do that often. You're basically right about performance. But performance is relative. If I use RegEx, even an external library, there are no problems that a user would notice when querying record numbers in the 5-digit range. In a query with mass data, I would never use compound...
  5. E

    Extracting varying length string between two characters

    What is the expression but applied programming? One could also argue that the expression represents a hard-coding of precise circumstances. Split is a bit more variable, and RegEx, if you can use it reasonably well, is a highly variable magic wand.
  6. E

    Add, Edit, or Delete a Function() using VBA

    Normally the frontend is simply replaced. The developer makes the necessary changes and provides the user with the new version. If the frontend is compiled (delivered as ACCDE), there is no alternative. Otherwise: 1) Reference to Microsoft Visual Basic for Applications Extensibility 5.3. This...
  7. E

    The Name function

    What if you believe the error message: If FileExists(TableName) Then Name TableName As FolderName Else Debug.Print "not found: " & TableName End If https://www.devhut.net/vba-determine-if-a-file-exists-or-not/
  8. E

    Solved Database backup

    Creating a copy will be less of a problem. However, you don't know whether this copy is error-free and can be used 100% as a backup. You shouldn't just assume something like that, you should check it explicitly. If you really need a backup, it should also be usable. Simple rule of thumb: In...
  9. E

    Yet another "Item not found in this collection" post

    Strictly speaking, a delete query always eliminates entire records. There is no need for a field list: DELETE FROM tblPhoneDirectory
  10. E

    Solved What is the key of dynamic forms in the Forms object?

    You only open a form, creating it is something else => use design mode and take appropriate action by hand or code. A form is a class, and opened forms are "only" instances of this class. The form name is actually the name of the class, which is then passed on as a property of the instance. If...
  11. E

    Solved How to get affected records count of an update query?

    I explicitly included a DB reference as an argument because I basically wanted to take into account unlinked tables from external databases. The test used by @MarkK via MSysObjects will then fail in this form. Of course, one have to initialize this reference before calling it. But that was less...
  12. E

    Solved How to get affected records count of an update query?

    Note: I always see the effort to put together an SQL statement using code. I personally prefer to pass a complete SQL statement as an argument, and also the name of a saved query. For me it makes more sense to write a query the way it should look, rather than trying to put it together somehow...
  13. E

    Solved Opening an Access database to a form, then get and error.

    I would suspect less of a data problem. If the amount of data to be loaded is larger than the currently available memory, the data is automatically switched to the swap file on the hard disk. The result is that the processing speed drops significantly. Or should the swap file be too small? I...
  14. E

    Looking for Faster way to update Table - boolean field

    In this topic, however, we are primarily dealing with the task described in #1: marking the records in the table in which the associated file no longer exists. Something missing can only be determined by comparing what is complete with what is present => a classic task for SQL, and for this you...
  15. E

    Looking for Faster way to update Table - boolean field

    Therefore, it would be beneficial to monitor the file system itself and to immediately record current changes and pass them on to the database. Something like this could help. https://www.codeproject.com/Articles/42212/WMI-and-File-System-Monitoring
  16. E

    Use a value from a subform to a report.

    #Name? ... means that something is unknown. The existing rule of getting values from somewhere doesn't work like that. The first step should therefore be to look at what exactly you are doing. So, what do you have planned? Simply complaining is of no use. It makes more sense, also in the sense...
  17. E

    Are Muslims and the Quran a threat to our society?

    A great quote. One should also beware of political leaders who insult others and spread hatred and division.
  18. E

    Solved Finding Tenure Time

    I haven't tested the function sufficient yet. I guess the initial test needs to be changed. If intYears <1 Then ' => If intMonths <13 or something similar, and adjust the other lines of code accordingly. Try it yourself, you learn best by doing.
  19. E

    Solved Finding Tenure Time

    Yes, it's the same logic. Day is preferred here because it returns Long, while the Format function produces a String. Comparing using numbers is faster than using strings because fewer bytes are needed for representation. Format(Date, "mmdd") ' could also be replaced to generate numbers by...
  20. E

    Solved Finding Tenure Time

    It is just a demarcation from your code. The name of the function can be anything you want, it just needs to be self-explanatory. DateDiff should be self-explanatory, or compare in the documentation. However, when it comes to years, it makes a difference whether the Hire_Date is before or after...
Back
Top Bottom