Search results

  1. Ken Sheridan

    Transactions or Delete queries

    Is the relationship between the parent form's table and the subform's table one-to-many, as is generally the case? If so you can simply enforce cascade deletes in the relationship, so that deleting the parent form's current record will automatically delete the referencing records in the...
  2. Ken Sheridan

    Date handling

    To return all appointments for the day following the current date a query would be along these lines: SELECT * FROM Appointments WHERE AppointmentDate >= DATE()+1 AND AppointmentDate < DATE()+2; To return all appointments on or later than the seventh date from the current date: SELECT * FROM...
  3. Ken Sheridan

    Date handling

    That's not the case, as can be seen in the immediate window, as of today 27th March. dtmAppointment = #2026-03-28 14:30# ? dtmAppointment >= VBA.Date+1 True The inclusion of a non-zero time of day in the appointment date/time value is irrelevant as the expression will evaluate to True for any...
  4. Ken Sheridan

    Rounding Issue

    Many thanks to everyone. It's been most instructive.
  5. Ken Sheridan

    Rounding Issue

    I get that. What I can't understand is why when the Int function is used in my function and the operand is an integer number, it returns the wrong value in this one case, but not in the other 34, whereas the CInt funtion returns the correct value. I'm confident the underlying maths is correct...
  6. Ken Sheridan

    Solved Requery underlying form, but retain bookmark

    You don't seem to have noticed the word also in the OED definition. But, enough time has been wasted on this. I'm no longer monitoring this thread.
  7. Ken Sheridan

    Rounding Issue

    Strange. It's the Int function which is returning -248 rather than -247 when I step through the code. I would not usually use the function for simple rounding to n decimal places. I designed it originally for rounding to intervals like 0.05 or #0:15#. Try changing it to: Public Function...
  8. Ken Sheridan

    Rounding Issue

    Many years ago I put together the following function with the help of New York mathematician James Fortune: Public Function RoundUp(dblVal As Double, dblTo As Double) As Double Dim lngTestValue As Long Dim dblTestValue As Double Dim dblDenominator As Double dblDenominator =...
  9. Ken Sheridan

    Solved Requery underlying form, but retain bookmark

    'As the OED entry shown below indicates, that's only a modern tendency, which is not supported by its etymology. I'm using it in it's original meaning, derived from the Latin fors (chance): As the replies from others here have made clear, a bookmark's pointing to the same row as it did before...
  10. Ken Sheridan

    Solved Requery underlying form, but retain bookmark

    No, it's merely fortuitous, in the same way that whether it's raining or not when the hedgehog visits my garden is fortuitous.
  11. Ken Sheridan

    Solved Requery underlying form, but retain bookmark

    It's not a matter of reliability. A hedgehog visits my garden from time to time. For the first nine visits it is always raining when it does so. I might therefore conclude that the hedgehog only visits my garden when it's raining. On its tenth visit it's not raining. This shows that my...
  12. Ken Sheridan

    Split up data

    Combining three separate attributes in a single column is not good relational database design. A principle of the database relational model is that each column position in each row in a table should be atomic, i.e. it should contain only one legitimate value, of the attribute type represented...
  13. Ken Sheridan

    Form footer not locked to detail section Access 2016

    As you haven't responded to my colleagues' replies, we don't know whether you have achieved a satisfactory solution, If not, you have three options: 1. If you set the subform control's VerticalAnchor property to Top, when you resize the parent form the subform will retain its design size and...
  14. Ken Sheridan

    Solved Requery underlying form, but retain bookmark

    Exactly, but now this old dog has learnt a new trick.
  15. Ken Sheridan

    Solved Requery underlying form, but retain bookmark

    None that I can think of. It's just the way I was taught to do it back in the last century.
  16. Ken Sheridan

    Update a column in table

    Here's the amended file. It now caters for a city's being in two or more regional units, e.g. Kansas City being in Kansas and Missouri. If a user enters a user enters a new city name, the combo box's NotInList event procedure now includes code to determine if a city of the same name currently...
  17. Ken Sheridan

    Solved Requery underlying form, but retain bookmark

    The following is the code, similar to that posted by MajP earlier, which I use in a form in which the rows are returned in transaction date order, which requeries the form and moves the record pointer to the updated/inserted record, which is now in its correct ordinal position: Private Sub...
  18. Ken Sheridan

    Solved Calculate from previous record in a datasheet, or continuous form

    To return a non-updatable recordset: SELECT T1.*, NZ ( T1.TransactionDate - ( SELECT MAX(TransactionDate) FROM Transactions AS T2 WHERE T2.TransactionDate < T1.TransactionDate )...
  19. Ken Sheridan

    Update a column in table

    You should be able to adapt it. I deliberately used the generic term 'region', which could be a state in the USA, a county here in the UK, or a prefecture in your case. While the amendments I'm proposing will cater for a binary relationship type between cities and regions, it would still work...
  20. Ken Sheridan

    Update a column in table

    For the purposes of my demo I've assumed that not to be the case. In reality I think it's an unwarranted assumption. I believe that there is more than one Springfield in at least one US state for instance. The solution would be to introduce County into the hierarchy of course, and to model...
Back
Top Bottom