By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,608 Members | 1,925 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,608 IT Pros & Developers. It's quick & easy.

How to use a listbox inside a subform to move through subform records

P: 91
I have a subform that holds a bunch of records for employees. Rather than manually scrolling through I want to be able to click on one and then the subform displays that record.

I tried
Expand|Select|Wrap|Line Numbers
  1. DoCmd.GoToRecord acForm, "frmsubEmployees", acGoTo, lstEmployees.Value
Which works fine if you have the subform open in its own window by itself. But if it is inside "frmAdministration" I get an error: "Run time error 2489, the object "frmsubEmployees" is not open"

If it matters, the subform inside "frmAdministration" is called "frmsubAdminEdit", then the SourceObject is changed to select the "frmsubEmployees". There is also a few other subforms that show up in "frmsubAdminEdit"
Jun 24 '10 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 2,653
Try to manipulate with frmsubEmployees Recordset using FindFirst or Seek methods. Like the following

<frmAdministration ref>.frmsubAdminEdit.Form.Recordset.FindFirst ...
<frmAdministration ref>.frmsubAdminEdit.Form.Recordset.Seek ...
Jun 25 '10 #2

P: 91
Shouldnt this be able to be done just with the DoCmd.GoToRecord?

What other code is required for doing it the recordset way?
Jun 25 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.