Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Populate subform based on combobox values in the main form

Posted on 2012-09-04
4
Medium Priority
?
979 Views
Last Modified: 2012-09-13
I am not able to see the list in subform when selecting an option from combo box from Main Form

Please help

Attached is the file
Chancery-Upgrade.accdb
0
Comment
Question by:mercybthomas74
  • 2
4 Comments
 
LVL 85
ID: 38364787
ChanceryItems.Report_Category and SMSReportList.Category are not related, so you can't use that as the Master and Child links for those forms. The datatype of ChanceryItems.REport_Category is Numeric, and the other is Text, so there's little chance of them being properly related at all.

What is your intent with the form? That is, what is the user expected to do with this?
0
 
LVL 40

Expert Comment

by:als315
ID: 38364813
Your table with report types have 2 columns: ID and Name, but in your table is stored name, so you should select name in combobox. Will be enough to change column in combobox parameters:
comboboxBut will be better to change table SMSReportsList and store there ID.
0
 

Author Comment

by:mercybthomas74
ID: 38364886
LSMConsulting:
The purpose is to show Reports based on the category selected from the combo box... in a sub form..
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 38367382
Then you need to do some rework, as als315 suggets

Your "Rpt_Category" table is fine. It lists the Report Categories, with their associated ID values

Your SMSReportsList, however, should store that ID value (i.e. the Numeric value from Rpt_Category.RptID). Instead, you're storing the value of Rpt_Category.Rpt_Category. I'm not sure how you create the SMSReportsList table, so cannot suggest how to fix it moving forward, but for now do this:

1) Change the Datatype of ChanceryItems.Report_Category to Number

2) Add a new column (Rpt_ID, perhaps) to the SMSReportsList table and fill it with the correct value from Rpt_Category.RptID. For example, if SMSReportsTable.Category is currently "CTE Reports", then enter the value of 3 in the new RptID field.

3) Change the Recordsource of your SMSReportsList Subform to this:

SELECT SMSReportsList.Category, SMSReportsList.[Report Name], SMSReportsList.RptID FROM SMSReportsList;

4) Change the Master/Child links of the subform on the ChanceryValidationItems form to
REPORT_CATEGORY/RptId.

And remember this: Anytime you need to associate one table with another you should store the Primary Key value of the Parent table in the Child.

========================

Also, in the future please be sure to Compact your database before uploading it. I did when I downloaded your old database, and it dropped from 2.9 mb to ~650kb. While many of the Experts enjoy a very fast connection, there are a LOT who depend on dialup or cellular networks, and downloading large items can be very slow (and expensive).
Chancery-Upgrade.accdb
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question