Locating Records

W

WLMPilot

I am new to Microsoft Access, but have had lots of experience in dBase. I am
trying to figure out how to locate a record (based in EmpID). So far as I
can tell, I can only create a query then input the criteria before it can
find the record. I want to have a display similar to or the same as a form
display, and in the EmpID field, enter the ID number and have the record
appear.

The general purpose would be to pull an employee record up in order to edit
appropriate fields, ie FT to PT, hourly wage change, etc.

Thanks,
Les
 
R

Ricky Hicks MVP

Search Access VBA Help for the FindFirst method to do this task ...

R. Hicks
 
P

PC Datasheet

Build a popup form (MyPopupForm) with some method to select or enter the
EmpID of the record you want to go to. Create a Close button on the form as
well as a Continue button. Put the following code in the Click event of the
Continue button:
Me.Visible = False

Put the following code in the Click event of Locate Employee button on your
Employee form:
DoCmd.OpenForm "MyPopUpForm",,,,,acDialog
If IsLoaded(MyPopUpForm") Then
Dim Rst As DAO.Recordset
Set Rst = Me.RecordsetClone
Rst.FindFirst "[EmpID] = " &
Forms!MyPopUpForm!NameOfEmpIDControlOnMyPopUpForm
Me.BookMark = Rst.BookMark
Rst.Close
Set Rst = Nothing
End If
 
Top