Results 1 to 3 of 3
  1. #1
    JulieAHop is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Location
    Netherlands
    Posts
    15

    Locking Fields

    Hi


    I'm hoping somebody can help.:-)

    I have a form where the user must make selections from three combo boxes, 1.Select Customer, 2. select Contact & 3. select Currency the 2nd & 3rd are bound to table QuoteHead, after the 2nd combo box is updated a quote no is generated and bound to QuoteHead using a before insert event.

    Within the form I have a subform (QuoteLine), what I really want to do is, when the user makes an entry into QuoteLine I want to lock the 3 combo boxes on QuoteHead.

    I have used this code on an after insert

    If IsNull(Me.Combo41) Then
    Combo41.Locked = False
    Else
    Combo41.Locked = True
    End If

    The same code for combo43 and the same for Currency. (If it's relevant the Currency field is set to a combo box at table level)

    The code works for the first 2 combo boxes but then fails on the Currency field.

    I am way off the mark with this?

    Any ideas greatly appreciated.

    Thanks

    Julie.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Only need 1 line...
    Combo41.Locked =not IsNull(Me.Combo41)

    Currency field may not be null.

  3. #3
    JulieAHop is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Location
    Netherlands
    Posts
    15
    Thanks again Ranman256, once again you've helped me out big time.

    Very much appreciated.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Locking and graying out fields in Access
    By ZandyRox in forum Forms
    Replies: 3
    Last Post: 08-16-2014, 08:15 AM
  2. Locking fields in Access form
    By sk88 in forum Access
    Replies: 10
    Last Post: 06-04-2012, 01:40 PM
  3. Locking a record
    By aytee111 in forum Access
    Replies: 3
    Last Post: 04-24-2012, 05:31 PM
  4. locking it down
    By BAX5127 in forum Access
    Replies: 0
    Last Post: 03-22-2011, 06:51 PM
  5. Locking fields
    By Icewolf0927 in forum Forms
    Replies: 3
    Last Post: 09-23-2010, 12:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums