Search results

  1. Ken Sheridan

    how to make lastlogin date & time

    Rather than being dependant on the user clicking the button, another method is to open a hidden form at start-up, and leave this open for the duration of the session. The exit time can then be logged when the form is closed, so will be executed however the database is closed. It's not tamper...
  2. Ken Sheridan

    Northwind Database VBA BusinessAddress Question

    In the query the business address is computed by the concatenation of the relevant columns from the table in an expression. If you do have occasion to concatenate values in this way you might find the following function useful: Public Function ConcatValues(strSeparator As String, ParamArray...
  3. Ken Sheridan

    text box showing record in Sub form

    In the image below Lname has been selected from the list of column names in the first combo box's drop down list. This causes the second combo box's drop down list to return all distinct values from the Lname column in the tblClients table. In the image White has been selected, and the Go...
  4. Ken Sheridan

    text box showing record in Sub form

    Using a subform is pointless when the parent form is unbound. Here's a further amended version of your file, in which the insurance number of the currently selected record in the detail section is shown in a text box in the form header. Why would you want to see it in the header when its...
  5. Ken Sheridan

    text box showing record in Sub form

    I'm attaching an amended copy of your file in which I've done what I think you might be aiming at. Rather than using a subform I've used a bound parent form, and put the unbound controls in the form header. The way it works is that a criterion is selected in the first combo box in the header...
  6. Ken Sheridan

    text box showing record in Sub form

    You say you want to return an Insurance Number in the control in the parent form, but there is no such column in either of the tables in your file. You'll need to explain in more detail what data you want returning, where it comes from, and how the data returned will de determined by the...
  7. Ken Sheridan

    Solved Help with subqueries

    Glad to have helped.
  8. Ken Sheridan

    Form as Form? or String?

    By specifically naming the two possible controls your code is very restrictive. The following, on the other hand, allows you to reference any form which contains one visible list box control. The number of list box control's in the form is completely arbitrary from 1 to n, as long as only one...
  9. Ken Sheridan

    Search data from one table to append to another table

    I see no need for a subform. A form bound to the SHOP_ITEMS_USED table would be sufficient. Either set its DataEntry property to True, or (better in my view) include code in its Load event procedure to move the form to an empty new record when it's opened. Data entry for the product into the...
  10. Ken Sheridan

    Solved Difficulty sorting an alphanumerical text field

    There is no need for that. Arnelgp's solution caters for any number of leading zeros. More importantly, adding the extra column means that the table is no longer normalized to Boyce Codd Normal Form (BCNF) as the new column is functionally determined by the registration number, which is not a...
  11. Ken Sheridan

    Form as Form? or String?

    If you standardise the RowSource properties of the list boxes in the form or forms containing the list boxes you want to address so that they start with SELECT DISTINCT, and the control's BoundColumn property is always 1, then you can get the correct column name for whichever list box is visible...
  12. Ken Sheridan

    Solved Help with subqueries

    The following query returns the rows from a Transactions table, numbered sequentially in TransactionDate order. In the event of two or more transactions being on the same date the TransactionID primary key acts as the tie breaker: SELECT COUNT(*) AS RowNumber, T1.TransactionDate...
  13. Ken Sheridan

    Moving staff roster to next month

    Firstly create a two column table as follows: EmployeeDays ....EmployeeID (FK) ....WorkDay This table is 'all key', i.e. its primary key is a composite of the two columns. The WorkDay column should be of integer number data type, and in each row contain a value for an employee's working day...
  14. Ken Sheridan

    Using VBA? [My THINKING] to LINK a BE

    If you know the paths to the alternative back ends, then it would be an easy matter to set the tabledef objects' CONNECT property at start-up to that appropriate to the current user based on their Windows login name. You'd just need a table of all authorised user names related to a table of...
  15. Ken Sheridan

    bad bracketing

    That's not the issue, which is whether, in building the string expression for the RowSource property, it is necessary to qualify the column names with the table names in the WHERE clause. The question posed by Gasman was 'Why would you supply a table name when all you are returning is some...
  16. Ken Sheridan

    Using VBA? [My THINKING] to LINK a BE

    For many years I've included code in front end databases' unbound opening form which checks to determine if the current links are valid. I have a number of different versions of this for different contexts. The attached zip archive includes a RefeshLinksSingle_07.accdb file which illustrates...
  17. Ken Sheridan

    bad bracketing

    You'd pass the column name as a string into that function. No need to qualify it with a table or query name unless it would otherwise be ambiguous. You'd then concatenate the return value of the function into a string expression, e.g. Me.YourListBoxName.Rowsource = "SELECT ckDate" & _ "...
  18. Ken Sheridan

    bad bracketing

    In that case you'd pass it as a string expresssion and then concatenate its value into a string expression, which you'd assign to the control's RowSource property e.g. with the following function in a form's module: Private GetRowSource(strDateColumn AS String, strTable AS String) As String...
  19. Ken Sheridan

    some issues with DB form

    What you currently have is really a spreadsheet masquerading as a table. A relational database is very different from a spreadsheet however, being made up of multiple related tables, each of which models an entity type in that part of the real world being modelled by the database, with each...
  20. Ken Sheridan

    Making the primary key as the client code from the client name

    You are correct on this point. You have a type hierarchy, in which individuals and busineses are sub-types of type contacts. A sub-type is characterised by sharing all attributes of its (super) type, but not those of other sub-types. The one change I'd suggest making would be to drop the...
Back
Top Bottom