Get the "Replace" out of Find/Replace (1 Viewer)

PhoenixofMT

Part-time Access Guru
Local time
Yesterday, 19:09
Joined
Jul 23, 2008
Messages
35
I have a find button on my form that opens the Find/Replace dialog. Because I don't want my users wantonly replacing half the entries in the table, my find button first sets AllowEdits to False. The problem I'm having is setting it back to True when the dialog is closed. I've found that if I set it before the Find dialog is closed, the Replace tab will magically appear when it gets focus again. Is there a way to tell if the dialog is still open before allowing edits?
 

PhoenixofMT

Part-time Access Guru
Local time
Yesterday, 19:09
Joined
Jul 23, 2008
Messages
35
Will I have to design my own Find interface around this method? I had thought of doing that, I just wanted to avoid the extra work if I could.
 

PhoenixofMT

Part-time Access Guru
Local time
Yesterday, 19:09
Joined
Jul 23, 2008
Messages
35
Here's what I came up with, if anyone's interested:
Code:
Private Sub <combobox>_KeyUp(KeyCode As Integer, Shift As Integer)
  Dim iPosition As Integer
  Dim sArgument As String
  
  iPosition = Me.<combobox>.SelStart
  sArgument = Me.<combobox>.Text
  
  Me.Undo
  
  DoCmd.FindRecord sArgument, acStart, , acSearchAll, , acCurrent
  
  With Me.<combobox>
    .SelStart = iPosition
    .SelLength = Len(.Value) - iPosition
  End With
  
End Sub
Set the combo box's AutoExpand property to No.
 

Users who are viewing this thread

Top Bottom