473,386 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
2 1467
FishVal
2,653 Expert 2GB
Try to manipulate with frmsubEmployees Recordset using FindFirst or Seek methods. Like the following

<frmAdministration ref>.frmsubAdminEdit.Form.Recordset.FindFirst ...
or
<frmAdministration ref>.frmsubAdminEdit.Form.Recordset.Seek ...
Jun 25 '10 #2
matt753
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

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

Similar topics

3
by: Mark | last post by:
When a main form goes to a different record, how do you detect that the subform has no records? Thanks! Mark
3
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name...
2
by: origin197511 | last post by:
Hello all... I'm having an issue with MSAccess 2000. I have a Form that holds records of my cartridge loads for a rifle and a subform that lists all groups that have been fired with that load. ...
0
by: Backslider | last post by:
I have a Listbox inside a Repeater control. I have AutoPostBack set to True. How do I handle the event? It doesn't apparently call the ItemCommand event, as a button would do. What event should...
0
by: SimonZ | last post by:
If I have gridView and one of the columns is template cpolumn, where I have listBox in edit mode: <asp:TemplateField> <HeaderTemplate>CategorName:</HeaderTemplate> <ItemTemplate> <asp:Label...
4
by: tlyczko | last post by:
I have been looking on the NGs and I found this code to show if a subform has no records. I have this code in the MAIN form OnClose event: Private Sub btnClose_Click() '4/16/06 new code that...
4
by: JohanV | last post by:
Hey all! I realise this must have been posted before, but I didn't find an answer by searching this site or the net. I'm hoping someone can tell me how to fix this, or can show me a different...
1
by: Kev | last post by:
Hello I have a form (RosterForm) based on a table - RosterRange RosterRange has 4 fields: RosterRangeID Autonumber RosterStartDate Date RosterEndDate Date (probably...
5
by: jrobbins | last post by:
public IEnumerable<AuthorizationObjectClass> GetEmployeeNoAuthorizations(SqlInt32 PersonnelNumber) { DataSet ds; AuthorizationObjectClass auth = new...
6
by: kucheravy | last post by:
Hi, everybody. I have this problem. When I put a <asp:ListBox on a web page and populate the data in the page Page_Load event the ViewState for the control is saved and loaded (after postback)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.