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

Selected record in subform appearing in main form

100+
P: 139
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
Share this Question
Share on Google+
2 Replies


jaxjagfan
Expert 100+
P: 254
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

100+
P: 139
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

Post your reply

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