Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2001

    Question Unanswered: How to determine determine if add new rec button was pressed in the before update


    I have a Bound form with the the builin navigation bar on.

    More over I have some code and validations written in the following events:

    A) Form - On current

    Have checked if add new record is triggered by either the moving past the last rec / by clicking the add new button.
    and handled the even accordingly.

    B) Form - Beforeupdate
    Have validated certain values and have asked user wether he wants to save changes. DEpending on the answer the record is either saved or changes discarded.

    C) Form - Afterupdate
    Certain other business logic gets executed.

    Now in case the user presses the addnew rec button (the built in one on the recordbar) the event that gets triggered is the before update .. the processing takes place as per the code .. but the record does not get updated neither does the add new event gets triggered. the records gets saved if I press the add new rec button the second time round and get the same message box all over again. this time the record gets saved but yet again new record is not added .. New record is added only and only if I press the add new rec button the third time.

    Well I can not disable the add rec button on the navigation bar while a record is being edited .. So currently I can not figure out how to handle the situation. (unless I get rid of the default bar and use a custom bar - which I am at present reluctant to do).


    Any suggestions / pointers welcome.


  2. #2
    Join Date
    Nov 2001
    Just my 2 cents.
    Taken from

    Sub NewRecordMark(frm As Form)
    Dim intnewrec As Integer

    intnewrec = frm.NewRecord
    If intnewrec = True Then
    MsgBox "You're in a new record." _
    & "@Do you want to add new data?" _
    & "@If not, move to an existing record."
    End If
    End Sub

  3. #3
    Join Date
    Dec 2001

    Unhappy Does not work :(

    If intnewrec = True Then
    Hi Thanks for the reply. but my problem is it does not the .newrecord property shows false instead of true and hence my code does not work as expected the first time round.


Posting Permissions

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