Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Location
    DC Metro, District Of Columbia, USA
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    yet another combo box issue (2002 in 2000 format)

    In HFeddema's Access 2002 in/out, page 198 -> "I can't select a value in a combo box ... the computer just beeps when I click on a selection in the drop-down list". Yup, tis mine. I culled this forum back 20+ pages and have tried most of the code in the replies (neat stuff I will/have included - assumption is public code,

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

    Re: yet another combo box issue (2002 in 2000 format)

    If Allow Edits is set to No, you won't be able to select anything in any control on the form, including a list boxes and combo boxes. One workaround is to set Allow Edits to Yes, but set all bound controls to Locked = Yes. Another is to put the combo box(s) in a custom toolbar.

  3. #3
    Star Lounger
    Join Date
    Feb 2003
    Location
    DC Metro, District Of Columbia, USA
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: yet another combo box issue (2002 in 2000 format)

    I hope this is what I have done with the following events:

    Private Sub cboActivity_AfterUpdate()
    On Error GoTo ErrorHandler

    Dim strSearch As String
    strSearch = "[Activity] = " & Chr$(39) & _
    Me![cboActivity] & Chr$(39)

    'Find the record matching the control.
    Me.Requery
    Me.RecordsetClone.FindFirst strSearch
    Me.Bookmark = Me.RecordsetClone.Bookmark

    'reset read-only property of allow edits
    Me.AllowEdits = False

    ErrorHandlerExit:
    Exit Sub

    ErrorHandler:
    MsgBox "Error No: " & Err.Number & "; Description: " & _
    Err.Description
    Resume ErrorHandlerExit

    End Sub

    Private Sub cboActivity_Click()
    On Error GoTo ErrorHandler

    'set allow edits to true for clicking a record
    Me.AllowEdits = True
    cboActivity.SetFocus

    ErrorHandlerExit:
    Exit Sub

    ErrorHandler:
    MsgBox "Error No: " & Err.Number & "; Description: " & _
    Err.Description
    Resume ErrorHandlerExit

    End Sub

    Is this the correct approach? I will set locked to yes.

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

    Re: yet another combo box issue (2002 in 2000 format)

    The On Click doesn't work for me. Instead of enabling edits in the On Click event, do it in the On Got Focus event of the combo box. And in the After Update event, move the line Me.AllowEdits = False down to below the ErrorHandlerExit label. That way, the form will be reset to read-only even if an error occurs.

  5. #5
    Star Lounger
    Join Date
    Feb 2003
    Location
    DC Metro, District Of Columbia, USA
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: yet another combo box issue (2002 in 2000 format)

    Thank you Hans. I will try this as soon as I get a new hard drive <grin>. What are the odds, --> error # XXXXX msg: block 215 uncorrectable data error or media is write protected! Uhhh, no write-protecting c: sooooooo, argggghhhhh!. Again tanx and as soon as the help desk gets me restored ( I hope network does regular backups), I will try the rewrites and get back to this forum and you. Good thing I take care of my house toys,

Posting Permissions

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