Search results

  1. 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...
  2. 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...
  3. 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)=")"
  4. 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...
  5. 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...
  6. 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'...
  7. 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...
  8. 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.
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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 =...
  14. 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...
  15. Ken Sheridan

    Multiple member List

    Your model is missing the second instance of the Member table.
  16. 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."
  17. Ken Sheridan

    How to add text to a null value field in an access report

    As this guarantees that an empty column position can only be Null, you can also set the column's DefaultValue property to N/A. Then execute the following UPDATE query to fill all Null column positions with N/A: UPDATE [TableNameGoesHere] SET [ColumnNameGoesHere] = "N/A" WHERE...
  18. Ken Sheridan

    Multiple member List

    In relational database terms marriage is a relationship between two entities of, in your case, type Member. To accommodate attributes such as WeddingDate the relationship can be modelled by a second table along the following lines: Marriages ....HusbandID (FK) ....WifeID (FK) ....WeddingDate...
  19. Ken Sheridan

    Solved How to run an append query to append Five lines same data in the same table

    Does the relationship between warehouses and products have any non-key attributes, e.g. QuantityOnHand? If so you will need to include a column for this in the 'junction' table which models the relationship. The column should be included in the parenthesized column list in the INSERT INTO...
Back
Top Bottom