Results 1 to 3 of 3
  1. #1
    GraemeG is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2011
    Posts
    152

    Combo box disabling other txtbox

    Hello.

    I have combo boxes with several options.
    i.e.
    FIELD: Entrance Doors Flats
    None


    Standard Door
    Fire Door
    Direct Access

    If a surveyor selects anything other than "None" they must answer a Quantity and Renew Year txtbox fields.

    Is there some code to disable these two txt boxes until they select a type of door. Or keep disabled if they select None?

    But also I want an afterform update to validate the code something like below: However it flags up at the minute regardless of the answer.


    Code:
    Private Sub Form_AfterUpdate()If Not Me.[Entrance Doors - Flats (Fire Doors)] = "None" And Nz(Me.EntranceDoorsFlatsRenewYear], "") = "" Then
    MsgBox "If an Entrance Door is Selected a Renew Year Must be Entered!"
    [EntranceDoorsFlatsRenewYear].SetFocus
    [EntranceDoorsFlatsRenewYear].BackColour = vbRed
    Cancel = True
    Exit Sub
    End If
    End Sub
    Also in this code if not answered it backcolours red. Once answered can this be returned to white?

    Thanks

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694

  3. #3
    GraemeG is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2011
    Posts
    152
    haha Thats one I am already asking lol

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

Similar Threads

  1. Enabling Disabling Combo Boxes from Values
    By vdanelia in forum Forms
    Replies: 3
    Last Post: 02-04-2011, 10:09 AM
  2. Disabling A Button
    By cksm4 in forum Programming
    Replies: 8
    Last Post: 10-05-2010, 02:07 PM
  3. Replies: 3
    Last Post: 08-08-2010, 12:21 PM
  4. txtbox moves everything else down
    By cowboy in forum Access
    Replies: 2
    Last Post: 01-06-2010, 05:45 PM
  5. Update from txtbox Help!
    By jbh02 in forum Queries
    Replies: 1
    Last Post: 09-29-2009, 10:14 AM

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