Search results

  1. Ken Sheridan

    Date format reverts back to previous format

    The US short date format is not a standard per se. Date literals can be any internationally unambiguous format, as well as mm/dd/yyyy. The ISO standard is YYYY-MM-DD. It would have made sense if this had been made the only acceptable format for date literals.
  2. Ken Sheridan

    Solved Duplicating values

    It sounds like your problem stems from a fault in the relationships between the underlying tables. The model for an Orders or similar database would include tables like those in the image below: The relationship type between Orders and Products is many-to-many, i.e. each order can include...
  3. Ken Sheridan

    Date format reverts back to previous format

    When I was young one of our officers had been a signaller in the Second World War. I recall him telling us that that was the solution adopted by the British and American forces in signals traffic to avoid misinterpretations of dates. I always use the ISO standard of YYYY-MM-DD for date literals.
  4. Ken Sheridan

    Debit and Credit Entries in Table

    I'm afraid that's not possible. Replicating the basic functionality of my demo database is a simple matter, however: Firstly let's assume for now that the database is for one account only. It can easily be adapted to cater for multiple accounts later if necessary. Start by creating a table...
  5. Ken Sheridan

    Calculations on a report

    Using multiple domain aggregation functions is a very unusual and inefficient way to build a report like this. Normally the data from the base tables would be aggregated in a query. The following is a simple example using Northwind Developers Edition tables as an example. Firstly the relevant...
  6. Ken Sheridan

    Solved Conditional formatting for date and text field

    That assumes the previous values are incremental. Even this cannot be guaranteed with absolute certainty. I'd add a DateTimeStamp column to the table and use that.
  7. Ken Sheridan

    Solved Conditional formatting for date and text field

    In that context, with the form at record 20, the DLookup function will return Null, which the NZ function will replace with the date before the date in the current row, so the expression as a whole will evaluate to False, regardless of the value of the previous date in record 17.
  8. Ken Sheridan

    Solved Code running report despite default set to not

    What happens if you drop the variable and use the following? If MsgBox("Print Customer Receipt?", vbYesNo + vbDefaultButton2) = vbYes Then DoCmd.OpenReport "rptPrintCustomerReceipt", WhereCondition:="[ContractNo] = " & Me.ContractNo End If
  9. Ken Sheridan

    Solved Conditional formatting for date and text field

    As theDBguy points out, an autonumber column is unreliable for anything other than ensuring distinct values. To ensure an unboken sequence you can compute the value when a row is inserted into a table. The attached little demo file illustrates this. Alternatively you can add a DateTimeStamp...
  10. Ken Sheridan

    Solved Code running report despite default set to not

    The vbYes constant is an integer data type. Its actual value is 6.
  11. Ken Sheridan

    Debit and Credit Entries in Table

    In the file attached to my last reply I'd omitted to amend the form's query so that the DSum function call was restricted to the the currently selected account. I've corrected this and attach the amended file to this post. I've included a couple of dummy accounts, one with a credit...
  12. Ken Sheridan

    Data model for recruitment database with reserve list

    For a binary relationship type like this you'll probably need two separate interfaces, one in which a Candidates parent form contains a subform based on the VacancyCandidate table which models the relationship type, the other in which a Vacancies parent form similarly contains a subform based on...
  13. Ken Sheridan

    Debit and Credit Entries in Table

    You might find the attached file helpful. It contains a simplified version of the original form whose RecordSource query I posted earlier. I've amended the query slightly so that it references an unbound text box control in the form header as a parameter to restrict the rows returned to an...
  14. Ken Sheridan

    Debit and Credit Entries in Table

    To record transactions in one or more current accounts you'd just need the one table, whose definition is as in the following image: Be sure to set the DefaultValue property of the Credit and Debit columns to 0. You'd then create a form whose RecordSource property is the name of the query...
  15. 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...
  16. 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...
  17. 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<= #" &...
  18. 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...
  19. 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...
  20. 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)=")"
Back
Top Bottom