Control Source problem?

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
 
D

Dirk Goldgar

Ursula said:
Hi Dirk,
\I tried the code in the debug window and frmEmployees
shows as an available form when the Go To Dialog is open.

What do you think I should try next? Thanks

If you're sure the error is raised on the line you mentioned, and the
error message is that it can't find the form, then I'm at a loss for the
moment. If you'd like to send me a cut-down copy of your database,
containing only the elements necessary to demonstrate the problem,
compacted and then zipped to less than 1MB in size (preferably much
smaller) -- I'll have a look at it, time permitting. You can send it
to the address derived by removing NO SPAM from the reply address of
this message.
 
U

Ursula

Okay, I'll pare it down and hopefully you'll have a chance
to look at the piece. If the frmEmployees is not open I
get the can't find form response, and it frmEmployees is
open, it simply does not switch.

Thanks
 

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