Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2004
    Posts
    173

    Unanswered: Simulated RecordExit Event

    Is it possible to code a simulated record exit event in Access 2000?

  2. #2
    Join Date
    Jun 2004
    Posts
    96
    record exit event? you want the system to perform something when you move the next record?
    try OnCurrent event.

  3. #3
    Join Date
    Apr 2004
    Posts
    173

    simulated record exit event

    Actually in this case that wouldn't work. I've got some subforms that need data validation for a bunch of related info. I need to be able to cancel the update of all the records involved. I think I'm going to use some custom navigation buttons and a form unload event to catch the possibility that the user made an error in entry. Thanks for the reply.

  4. #4
    Join Date
    Jun 2004
    Posts
    96
    if you DB has referential integrity set properly? with cascading update and delete enabled.. you can use AfterUpdate events? If validation fails, delete the primary record and foreign records should be deleted as well?

    Just a suggestion..

    Cyherus

  5. #5
    Join Date
    Apr 2004
    Posts
    173

    simulated record event

    I tried the AfteUpdate event except there was one problem. That event will fire when the user enters the subform and then will not fire again unless a change is made or required in the main form. If you know away around that let me know. Thanks for the reply. I did find an article in MicroSfts site about using an ADO recordset event to simulate this but decided on custom nav buttons instead.

  6. #6
    Join Date
    Jun 2004
    Posts
    96
    I thought you wanted to validate when the records are added or changed?

    Quote Originally Posted by mmbosman
    Actually in this case that wouldn't work. I've got some subforms that need data validation for a bunch of related info. I need to be able to cancel the update of all the records involved. I think I'm going to use some custom navigation buttons and a form unload event to catch the possibility that the user made an error in entry. Thanks for the reply.
    simple way for me is to look at afterupdate events for both the main and sub forms.. when main add/update is triggered, it validates main form, when sub form add/update is triggered, it validates sub form and decides if the main record needs to be deleted as well..

  7. #7
    Join Date
    Apr 2004
    Posts
    173

    simulated record exit event

    I do want to validate when a record is changed or added. Maybe I need to be more explicit. My main form is an invoice header with the payee info, total cost, etc. The subform is continuous forms with expense lines being applied to different accounts in each line. I need to validate that the sum of the entered lines ='s the invoice total. So a single beforeUpdate event triggered at the sub form level will always fail unless it is the last line entered (when the sum would equal the total), and a single beforeUpdate event for the main form will fail because the total can't be equalled when there are no lines yet entered. I planned on using the custom nav buttons but that doesn't allow for the shortcut keys. So if I got this all bassackwards please let me know. I need an event that fires when the user leaves the record to be sure the sum of the lines ='s the total of the invoice. Thanks for your replies.

  8. #8
    Join Date
    Jun 2004
    Posts
    96
    I see.. indeed, I don't rem having any 'when moving to next record' events. I guess custom nav is the only ans at the moment..
    u can trap short-cut keys using key-down events..?

  9. #9
    Join Date
    Apr 2004
    Posts
    173
    That's exactly what I did, and if my company upgrades to Access 2003 in the next 6 months I will be forced to find the person responsible for that decision and beat them soundly about the neck and shoulders. Thanks for the replies.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •