Go To Record Dialog/ Show record doesn't work

U

Ursula

Hello,

I have an employee form where on the form I have a button
to Go To Record (to choose an employee)which opens my
GoToRecordDialog form. This was working fine until I
changed the control source on the employee form from the
employee table to a query that includes the employee table
and another job class table. (Needed to do this to pull in
a description)

I can still get to the GoToRecordDialog and see the records
in my employee table, but when I select a record and click
on the button called Show Record, the record in the
employee form does not update to show the selected record.

Here's the code:
Private Sub ShowRecord_Click()
'Find the selected record, then close the dialog box.

Dim rst As DAO.Recordset

'Store the recordset for the Employees form.
Set rst = Forms!frmEmployees.RecordsetClone

'Locate the record for the selected employee.
rst.FindFirst "lngEmployeeID = " & List0

'Set the form's bookmark property to move to the record.
Forms!frmEmployees.Bookmark = rst.Bookmark

'Close the dialog box.
DoCmd.Close acForm, "GoToRecordDialog"
End Sub

The error is in the Set rst line as Access says it can't
find the form titled frmEmployees. I didn't change the
name of the form, only the control source. How do I get it
to work again? I compacted and repaired the database, but
still no luck. Any tips or advice would be wonderful.

Thanks
Ursula
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top