Search results

  1. Ken Sheridan

    Query with heading and row and listing

    Using the ISO standard for date notation of YYYY-MM-DD would solve that. Otherwise an IN clause with a value list of all dates in the desired order can be added. This also guarantees the return of all dates in the range if any are unrepresented in the data, so would show any dates where no...
  2. Ken Sheridan

    Solved VBA Database.Execute("CreateTable...") - Table created in CurrentDB, not the specified DB

    The following code snippet creates a temporary external database, and then creates two tables in it. Finally it creates links in the current database to the two tables: Dim dbs As DAO.Database, dbsTemp As DAO.Database, qdf As DAO.QueryDef, tdf As DAO.TableDef Dim varFld As Variant...
  3. Ken Sheridan

    Debit and Credit Entries in Table

    If you do decide to use Access rather than Excel you can then base a form on a query like the following: SELECT Format( DSum ( "Credit-Debit", "CurrentAccounts", "AccountNumber = ""12345678"" And TransactionDate<= #" &...
  4. Ken Sheridan

    Change the background colour to red if the (word) or (words) are surrounded by a Bracket

    That will return True if the string expression contains a leading parenthesis anywhere in the string, so assumes this will be matched by a closing parenthesis. If the Instr function is to be used, a more robust expression, which will only return True if there are correctly positioned opening...
  5. Ken Sheridan

    Using VBA to find perfect numbers, and accurately calculate pi to 100,000 decimal places.

    It's application to a person who undertakes calculations was the original meaning of the word computer, whose first occurrence is in the mid 17th century. It only became applied to a device for performing calculations in the late 19th century. The transitive verb compute first occurs in the...
  6. Ken Sheridan

    Change the background colour to red if the (word) or (words) are surrounded by a Bracket

    If the complete contents of the control are enclosed in parentheses, as in your posted examples, try the following expression: Left([FullName],1)="(" And Right([FullName],1)=")"
  7. Ken Sheridan

    How to query db with memory array data?

    I think that's probably true. Does the IN operator make use of the indexes? It can be expanded algebraically to a set of OR operations, in which I'd guess case it would. I always found the InParam function efficient enough in my line of work as an Environmental Planning Officer, but we were...
  8. Ken Sheridan

    How to query db with memory array data?

    If code similar to Tom's in post #3 is used to build a delimited value list, by assigning the value list to a text box control in a form, the control can then be referenced as a parameter in a query by calling the InParam function from the following module published by Microsoft many years ago...
  9. Ken Sheridan

    Strange query behavior

    That's not a matter of normalization. SUPERVISORCODE_I is a candidate key, and it's perfectly legitimate to make it the primary key of the referenced table, and the foreign key of the referencing table. In some contexts there are advantages in using a 'natural' key rather than a 'surrogate'...
  10. Ken Sheridan

    How to always set focus on the control on parent form after entering data in the subform

    Line numbers can also be returned in the subform's RecordSource query. The most efficient method is by means of a join of two instances of the table. The following is an example which numbers rows sequentially within each subset of rows per customer ordered by date: SELECT COUNT(*) AS...
  11. Ken Sheridan

    How to always set focus on the control on parent form after entering data in the subform

    This should be done before inserting a row into the referencing table. If a new order is being inserted in the parent form, referential integrity would otherwise be violated if the row has not yet been saved.
  12. Ken Sheridan

    How to always set focus on the control on parent form after entering data in the subform

    Here's a little procedure I added to a contacts form to add a new employer in a subform: Private Sub cmdAddEmployer_Click() With Me.sfcEmployers.Form.Recordset .AddNew .Fields("ContactID") = Me.ContactID .Fields("EmployerID") = 1 .Update End With...
  13. Ken Sheridan

    How to always set focus on the control on parent form after entering data in the subform

    That returns a reference to the subform, it doesn't move focus to it. In fact the subform is not really relevant to the problem, which is that focus is not returned to the text box in the parent form. The Me keyword will continue to return a reference to the class in which the code is...
  14. Ken Sheridan

    How to always set focus on the control on parent form after entering data in the subform

    That would be my natural conclusion too, but they say 'The people scan the barcode on the parent form on the control called txtProductCode that works fine no issues data is transfered to the subform', which suggests that the AfterUpdate event procedure's code is being executed. What surprises...
  15. Ken Sheridan

    Multiple member List

    It seems to me that the OP already has the table he needs for recording the membership of the prayer groups in a manner satisfactory to his preferences. It would benefit from some minor improvements such as the splitting of the member's name into FirstName and LastName columns, and the creation...
  16. Ken Sheridan

    Multiple member List

    A History table is unnecessary, it's inherent in the model: SELECT M1.FirstName & " " & M1.LastName AS Husband, M2.FirstName & " " & M2.LastName AS Wife, WeddingDate FROM Members AS M2 INNER JOIN ( Members AS M1 INNER JOIN Marriages ON M1.MemberID =...
  17. Ken Sheridan

    Trying to wrap my brain around table normalization in a 1:many relationship

    What you describe is an example of such a basic one to many relationship type, that I find it hard to believe it will help in understanding a more complex model. In my experience simplification of an issue, though well intentioned, tends to result in obfuscation rather than throwing light on an...
  18. Ken Sheridan

    Multiple member List

    Your model is missing the second instance of the Member table.
  19. Ken Sheridan

    Multiple member List

    See the OP: "Am facing a problem with my Access database of members which I build for a Christian Prayer Fellowship."
Back
Top Bottom