Search results

  1. E

    strSql errors

    TotalRecords = DCount("CodeNo", "ImportEquipment", "([Code No]) = '" & Me.CodeNo & "'") ' ... strSql = "SELECT * FROM [ImportEquipment] WHERE ([Code No]) = " & Me.CodeNo & "" Please put the dice down. You must already know and decide what data type [Code No] has and how to use it. What does...
  2. E

    Solved How to sort a combobox using VBA

    Wasn't it about sorting? SELECT [Name] FROM MSysObjects WHERE Right([Name], 3) <> "Sub" ORDER BY [Name]
  3. E

    Mid/Left/Right

    Of course. You only showed what should be isolated from one line. Then you should also show a complete list with the original expression and the exact expression to be isolated from it. A complete list does not mean all (imaginable) 1000 lines, but all typical variants should be included, and...
  4. E

    Mid/Left/Right

    SELECT Right(F1, 10) AS Result FROM tbltcc01 WHERE F1 LIKE ":20C*"
  5. E

    'Next n' Looping rather than moving to the next record

    The use of recordsets could be improved. But comparing two tables is actually work for queries. First an update query to update existing records. Second, an append query to append the new records. Since you are working with more than two tables and record sets, I don't understand your plan well...
  6. E

    'Next n' Looping rather than moving to the next record

    For n = 1 To TotalRecords TotalRecords is determined from a completely different recordset than the recordsets you are working with. Counting is unnecessary anyway if you use the following loop construction (or an equivalent one): Do While Not rs.EOF ' ... rs.MoveNext Loop This means that...
  7. E

    Solved Alias

    If you want to read a text in German - here are some thoughts I have put down: Basics - SQL is easy (11) - Order of query processing https://www.ms-office-forum.net/forum/showthread.php?t=353639
  8. E

    Solved Alias

    @Minty's suggestion is correct. However, when using it, you must note the following: The assigned column alias only has an external effect and partly in the SELECT part of the query. As a query execution is very different from running through the SQL statement from top to bottom, the column...
  9. E

    Number Crunching

    The rank generation should then use a different source. ' not SELECT item FROM TabX ' rather SELECT DISTINCT item FROM TabX In a second step, the determined rank would then have to be assigned to all records in the TabX table by linking them via item. This can all be solved using a query...
  10. E

    Solved TOP

    I'll try it. Two instances of the same table tabX are used. Instance T stands for the display of all fields externally. The subquery is accessed via the filter. Instance X is used in the subquery for the actual calculation. WHERE X.ProductID = T.ProductID This expression acts like a...
  11. E

    Solved IIf returning error

    I am not entirely sure in which cases exactly, but sometimes the interpreter evaluates the Else branch even if it is not controlled according to the program logic. If V=0, then this results in a division by 0 with a mandatory error. If you keep your expression without taking NULL into account...
  12. E

    open saved import external data vba code

    Your conclusion is wrong. Of course, if text files always have the same structure, a specification only needs to be created once and then it will remain the same. This is the standard case, which is what we always aim for - with the emphasis on text files with the same structure. However, text...
  13. E

    open saved import external data vba code

    Using a graphical interface for manual selection interrupts automated programmed processes.
  14. E

    open saved import external data vba code

    In the old style, the specifications are in two system tables. Once you understand these tables, you can also change the relevant record via query/recordset and thus fully automatically during the import.
  15. E

    Solved Query to Get First and Last Record in a Single Row

    Related to the one date field: SELECT StudentID, MIN(DateOfAdmission) AS FirstClassAttended, MAX(DateOfAdmission) AS LastClassAttended FROM tblStudentClass GROUP BY StudentID
  16. E

    Import text file

    Set the delimiter to a character that does not exist in your text, e.g. a pipe. Then the text file content can only be interpreted as a field, provided that there are no line breaks.
  17. E

    Loop through folder and save as Txt

    To analyze a string, you don't have to import it into a field in an Access table first. With a function like the one linked below, you can read the contents of any file, preferably a text file, into a string variable and then immediately start your analysis and processing. The corresponding...
  18. E

    too slow on getting calc done

    No. A TextBox wants a single value as its content. A query returns a recordset, which is an object with rows and columns, and even with only one column and one value, a recordset is still an object and not a single value.
  19. E

    too slow on getting calc done

    The controls in a form have at least the same events in a bound form as in an unbound form, so yes, a double click is usable (in form, not in query).
  20. E

    How to get current month data in access query

    That's why the advantages of having and using indexes cannot be repeated often enough. That's why it's better to always show and explain the solution using indexes in suggestions rather than an obvious "intuitive" simple solution. Therefore, many textbooks and tutorials should be rewritten...
Back
Top Bottom