G
Guest
Ok. This is odd....
I programmed a button to act as a "Finder". I modified the code that the
form wizard develops for you. Basically, it asks whether or not you want to
search by a number. This "number" field is typically locked, disabled and
otherwise untouchable unless the code makes it available. (In the past,
people have changed these numbers and not realized they did it....)
It used to work without issue. I have changed nothing in the code that does
the find. However, when I push the button now and answer "Yes" - search by
number, I receive an error message "Can't use find replace now". It leaves
this field unlocked and with the focus. I can push CTRL +F and do the search
anyway....... what gives???
Here is the code for the routine:
Private Sub FindRecord_Click()
On Error GoTo Err_FindRecord_Click
Dim SearchWhere
SearchWhere = MsgBox("No' searches from Selected Field", vbYesNo +
vbDefaultButton1 + vbQuestion, "Search by Number?")
If SearchWhere = vbYes Then
Me![JobNum].Enabled = True
Me![JobNum].Locked = False
Me![JobNum].SetFocus
Else
Screen.PreviousControl.SetFocus
End If
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_FindRecord_Click:
Exit Sub
Err_FindRecord_Click:
MsgBox Err.Description
Resume Exit_FindRecord_Click
End Sub
like I said, it used to work without error. Did something else get changed
in the database to generate this error??
Any helps and clues would be greatly appreciated
I programmed a button to act as a "Finder". I modified the code that the
form wizard develops for you. Basically, it asks whether or not you want to
search by a number. This "number" field is typically locked, disabled and
otherwise untouchable unless the code makes it available. (In the past,
people have changed these numbers and not realized they did it....)
It used to work without issue. I have changed nothing in the code that does
the find. However, when I push the button now and answer "Yes" - search by
number, I receive an error message "Can't use find replace now". It leaves
this field unlocked and with the focus. I can push CTRL +F and do the search
anyway....... what gives???
Here is the code for the routine:
Private Sub FindRecord_Click()
On Error GoTo Err_FindRecord_Click
Dim SearchWhere
SearchWhere = MsgBox("No' searches from Selected Field", vbYesNo +
vbDefaultButton1 + vbQuestion, "Search by Number?")
If SearchWhere = vbYes Then
Me![JobNum].Enabled = True
Me![JobNum].Locked = False
Me![JobNum].SetFocus
Else
Screen.PreviousControl.SetFocus
End If
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_FindRecord_Click:
Exit Sub
Err_FindRecord_Click:
MsgBox Err.Description
Resume Exit_FindRecord_Click
End Sub
like I said, it used to work without error. Did something else get changed
in the database to generate this error??
Any helps and clues would be greatly appreciated