Results 1 to 5 of 5

Thread: Avoiding modification

  1. #1
    Join Date
    Apr 2003
    Posts
    2

    Avoiding modification

    Hello,

    I have a textbox called ClientID. Each time we have new client, we add in client ID etc etc.

    The problem is, being a text box it is open for modification, unless that some Event code is added.

    I have put Msgbox pop up saying, Hay you cannot change this, on modification of ClientID.
    However this kinda look dodgy.
    Coz, say ID is 001, and I write over it e.g: 0, the Msgbox pops up, and I click OK, and I have 0 instead of 001. I still change the Client ID.

    Is there a way, that I click the Ok button, and no changes happened?

    OK is there another way ?
    Thanks!

  2. #2
    Join Date
    Nov 2002
    Location
    DE
    Posts
    246
    In the properties of your form you can set "Allow Edit" & "Allow Deletion" to No.
    This will allow your users to add new records still but modification of existing records is no longer possible

  3. #3
    Join Date
    Apr 2003
    Posts
    2
    Hello again,

    I take a look at AllowEdits and Allow Deletions, I cant figure out where to put these expression

    Where in property of the textbox that i could put these expression?

    Thank you!

  4. #4
    Join Date
    Nov 2002
    Location
    DE
    Posts
    246
    These are properties of the form not of the text box.

  5. #5
    Join Date
    Feb 2003
    Posts
    102
    Sorry for jumping in. Just say the user wants to modify other attributes of the record?

    If you want the textbox to be read only after the record has been created try

    'untested and air code but should work
    Private ClientID_BeforeUpdate(Cancel As Integer)

    If Not me.NewRecord then
    me.undo
    Msgbox "Can't change"
    End if

    End Sub

    Note the event if before update.

    HTH,

    Peter

Posting Permissions

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