View Single Post
  #9 (permalink)  
Old January 18th, 2007, 10:51 AM
donevco donevco is offline
Authorized User
Join Date: Nov 2006
Location: Evergreen, CO, USA.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts

I implemented your solution, but created a problem. I use a combo box to select the person's record, and allowedits = false prevents the combo box from working. I added a control cmdFindName to set allowedits to true. This works, but seems awkward. Here's my code. Better suggestions?

Private Sub cmdFindName_Click()
' enable cboFindName
On Error GoTo Err_cmdFindName_Click
    Me.AllowEdits = True
    lblFindName.Visible = True
    Exit Sub

    MsgBox (Err.Number & " " & Err.Description)
    Resume Exit_cmdFindName_Click

End Sub
Private Sub cboFindName_AfterUpdate()
    ' Find the record that matches the control.
    On Error GoTo Err_cboFindName_After
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Email] = '" & Me![cboFindName] & "'"
    Me.Bookmark = rs.Bookmark
    Me.AllowEdits = False
    Exit Sub


    Resume Exit_cboFindName_After
End Sub