Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Me!KlntID Or ME!txtKlntID (MS Access 2007)

    In my form frmKlanten i have a textbox that is named "txtKlntID". The recordsource of this textbox is the field "KlntID" in the table tblKanten.
    Each time a new record is added, a new KlntID number is generated by the function
    acbGetCounter(tblKlantenID"). The table tblKlantenID contains only one field with the next available klntID number.
    In my code (see below ), i assign this new klntID directly to me! KlntID, which is the name of the field in the table tblKlanten.
    Now I wonder if this is OK, or do I have to change this code such a way that the new klntID is assigned first to the textbox me!txtklntID instead of directly to the field KlntID, so that
    only after happening the afterupdate of the form, the new klntid is entered in the table?
    Are both methods allright or is one of then preferable?
    e.g instead of

    If IsNull(Me!txtKlntID) Then
    Me!klntID = acbGetCounter("tblKlantenID")
    Me![txtKlntID].Locked = True
    End If

    If IsNull(Me!txtKlntID) Then
    Me!txtklntID = acbGetCounter("tblKlantenID")
    Me![txtKlntID].Locked = True
    End If

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

    Re: Me!KlntID Or ME!txtKlntID (MS Access 2007)

    It doesn't matter. The value won't be stored until the record is saved in either case.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Brugge, Belgium
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Me!KlntID Or ME!txtKlntID (MS Access 2007)

    Thank you for the help

Posting Permissions

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