Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Another Prevent Edit Problem (A2K SP3)

    I have a frmCheckInLast that calls up the last rental record of a guest by entering the room number. I don

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Another Prevent Edit Problem (A2K SP3)

    You have code in the On Lost Focus event of RentPaidDate that modifies another control (OrigARDate). You don't need this code, since the user is not supposed to modify anything. If you remove it (or comment it out by inserting apostrophes ' in front of each line), RentPaidDate will remain locked.

    There is a lot of other similar code that is not needed in this form, but since it is never called, it doesn't do harm either.

  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Another Prevent Edit Problem (A2K SP3)

    Thanks for your quick reply.

    After the operator reviews the information, normally they extend the guest's stay by pressing the New Record button. This creates a new record (using the same form) and populates as many of the fields as possible from the information in the displayed record. The code in the On Lost Focus event and elsewhere is used when the operator completes the data in the new record. See modAuto_Fill_NewRecord which you are someone on the forum designed for me a long time ago.

    Tom

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Another Prevent Edit Problem (A2K SP3)

    Try this, then (additions in bold text):

    Private Sub RentPaidDate_LostFocus()
    If Me.NewRecord Then
    If Me.[PayID] = 7 Or Me.[PayID] = 9 Or Me.[PayID2] = 7 Or Me.[PayID2] = 9 Then
    Me.[OrigARDate] = Me.[RentPaidDate]
    Else
    Me.[OrigARDate] = Null
    End If
    End If
    End Sub

    This only changes OrigARDate in a new record, not in existing records.

  5. #5
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Another Prevent Edit Problem (A2K SP3)

    Hans,

    Many thanks as usual.

    Tom

Posting Permissions

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