473,378 Members | 1,412 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,378 software developers and data experts.

Selected record in subform appearing in main form

139 100+
Hello,

I've not had a lot of luck getting this to work, despite looking around lots of websites, so here goes...

I have a main form frmProjectScheduler. It's a tabbed form and the front page is a switchboard.

The front page shows a chart of uncompleted jobs, generated from a query qryUncompletedJobs. When a button next to this chart is clicked, a new form frmListUncompleted appears, showing the results of this query in a listbox, lstMyUncompleted.

What I need to do is to click any of these items in the listbox and cycle to the corresponding record in the main form frmProjectScheduler.

The listbox is bound to the ID field of the query.

Any idea how I get the selected record to appear in the main form?

Thanks!
Neil
Jan 28 '08 #1
2 2372
jaxjagfan
254 Expert 100+
Hello,

I've not had a lot of luck getting this to work, despite looking around lots of websites, so here goes...

I have a main form frmProjectScheduler. It's a tabbed form and the front page is a switchboard.

The front page shows a chart of uncompleted jobs, generated from a query qryUncompletedJobs. When a button next to this chart is clicked, a new form frmListUncompleted appears, showing the results of this query in a listbox, lstMyUncompleted.

What I need to do is to click any of these items in the listbox and cycle to the corresponding record in the main form frmProjectScheduler.

The listbox is bound to the ID field of the query.

Any idea how I get the selected record to appear in the main form?

Thanks!
Neil
Here's what I use in a similar database

Private Sub lstProjects_DblClick(Cancel As Integer)

Dim strForm As String, intProj As Integer, strCriteria As String
intProj = Me.lstProjects.Column(1)
strForm = "frmProjectInfo"
strCriteria = "[ProjID]=" & [intProj] & ""
DoCmd.OpenForm strForm, , , strCriteria

End Sub

This will filter your main project form to the project selected form the listbox.
Jan 28 '08 #2
ndeeley
139 100+
Here's what I use in a similar database

Private Sub lstProjects_DblClick(Cancel As Integer)

Dim strForm As String, intProj As Integer, strCriteria As String
intProj = Me.lstProjects.Column(1)
strForm = "frmProjectInfo"
strCriteria = "[ProjID]=" & [intProj] & ""
DoCmd.OpenForm strForm, , , strCriteria

End Sub

This will filter your main project form to the project selected form the listbox.

Hello!

Thanks for your help. I still can't get it to work tho. It is driving me mad!

Cheers
Neil
Jan 29 '08 #3

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

Similar topics

0
by: Carl | last post by:
I have a main form with navigation buttons on it and a label showing for example Record 1 of 15 using recordsetclone on it and eveything works fine. When I move through the records the record...
7
by: ChrisR | last post by:
Hi guys My app is a simple Main form with a few Subforms that are not linked, and a few pop forms. Problem is: I have a pop form with a Listbox with a list of records related to the...
6
by: Steve | last post by:
I have a form, primary subform and secondary subform. A tab control takes up all the area of the primary subform. There are about 15 tabs on the tabcontrol. Each tab contains fields from the same...
5
by: Bob | last post by:
Hi Everybody I have a form called frmListBox that is connected to a table tblListBox. This is opened from a form called "frmInvoiceOrder" which has a subform called "zfrmInvoiceOrder" and...
1
by: Jacko | last post by:
I have a command button on one form (frmDelete) which deletes a record from the subform (frmGrant) of a main form (frmCustomer) which is open behind it. Problem is, when I go back to frmCustomer...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can...
7
by: dscarbor | last post by:
I have a simple form with 4 fields, and a subform that retrieves records that are potential matches based on a query. The user will use the ID from the subform record and enter it into one of the...
1
by: Coll | last post by:
I have a form with a subform on it. On my main form, you select an employee id number and the top portion of form fills in with data, and the bottom portion of the form,which is a subform, lists...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...

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.