How to lock record is showing

N

Nova

I use goto control and recordfind when text box "ID" afterupdate event. The
record is correct but when I scroll mouse the record is change to other. How
can I lock record to show only match with textbox "ID". Myform is single form
 
K

Ken Sheridan

Rather than navigating to the record filter the form with code along the
following lines in the control's AfterUpdate event procedure:

Me.Flter = "YourField = " & Me.ID
Me,FilterOn = True

This assumes YourField is a number data type. If its text data type use:

Me.Flter = "YourField = """ & Me.ID & """"
Me,FilterOn = True

To clear the filter either use the built in button on the Forms toolbar, or
a custom button on the form with the following in its Click event procedure:

Me.FilterOn = False

Ken Sheridan
Stafford, England
 
Top