Code:
Private Sub searchfield_BeforeUpdate(Cancel As Integer)
End Sub
Private Sub searchfield_Click()
End Sub
Private Sub searchfield_Exit(Cancel As Integer)
DoCmd.GoToControl ("COUNTERPARTY")
Me.Requery
DoCmd.GoToControl ("COUNTERPARTY")
End Sub
this is three different events.
one is the BEFORE UPDATE event of your searchfield (which is doing nothing)
one is the ON CLICK event of your searchfield (which is doing nothing)
and one is the ON EXIT event of your searchfield in which you're calling your gotocontrol twice.
so firstly, and for the last time, please, please, please just click on the ON EXIT event of the SEARCHFIELD text box. Click ONCE on the row that says ON CLICK. At the far right hand side of that row a small button will appear that has three dots on it (...). Click that button it should take you to the section of code that says:
Code:
Private Sub searchfield_Exit(Cancel As Integer)
DoCmd.GoToControl ("COUNTERPARTY")
Me.Requery
DoCmd.GoToControl ("COUNTERPARTY")
End Sub
if it does, remove remove the first DOCMD.GOTCONTROL("COUNTERPARTY")
if it does NOT then you have not named your searchfield correctly and you have to rename the unbound textbox to SEARCHFIELD, then go back through this same process to attach the code to your ON CLICK event.
Secondly. If you are getting a parameter value prompt you have NOT named all of your objects the same, either your form name or your unbound text box SEARCHFIELD is no longer named SEARCHFIELD (as mentioned above) and you need to fix those two items.