Table uses a select statement as value to populate subform data

I have a project that is using a table that contains a select statement as 
the value.

This table is used to output TypeName which is the field title in the 
metrics table to a form as if it were row data and TypeQuery will populate 
the subform.

The form will display the TypeName and the subform should display the data 
for related select statement in TypeQuery. The Yes/No will indicate if that 
data is readonly (a calculated amount) if not readOnly then they can enter 
new or change data in the subform.

TypeName         IsReadOnly     TypeQuery
1stAlias Name     Yes/No          Select YearID,  UserRate FROM MetricType_qry
2ndAlias Name    Yes/No          Select YearID,  ClassCompleted  FROM 
MetricType_qry
etc.
The output should be:
Form:
1st Alias Name
SubForm:
2009    124
2008    234
2007    198

I'm having trouble getting this to work in the subform. 
My question is how do I connect to the select statement in the table and 
return the selected data to the subform?
Any suggestions would be appreciated.
Thanks.
0
Utf
12/3/2009 3:52:01 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
1114 Views

Similar Articles

[PageSpeed] 18

Mary

Are you saying that the table definition includes a "lookup" field?  If so, 
you've (re-)discovered one of the reasons why folks here in the newsgroups 
hold "lookup fields" in tables in low regard.  The field in the table is 
actually storing the rowID of the looked up value, but displaying the looked 
up value.  This is confusing, no?!

The recommended approach is to convert that lookup field back to the 
appropriate data type to hold the rowID, then use a combobox in a form to do 
any looking up...

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

-- 
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Mary" <Mary@discussions.microsoft.com> wrote in message 
news:75CF9019-E963-4DDA-B00D-6D5DB6DD7926@microsoft.com...
>I have a project that is using a table that contains a select statement as
> the value.
>
> This table is used to output TypeName which is the field title in the
> metrics table to a form as if it were row data and TypeQuery will populate
> the subform.
>
> The form will display the TypeName and the subform should display the data
> for related select statement in TypeQuery. The Yes/No will indicate if 
> that
> data is readonly (a calculated amount) if not readOnly then they can enter
> new or change data in the subform.
>
> TypeName         IsReadOnly     TypeQuery
> 1stAlias Name     Yes/No          Select YearID,  UserRate FROM 
> MetricType_qry
> 2ndAlias Name    Yes/No          Select YearID,  ClassCompleted  FROM
> MetricType_qry
> etc.
> The output should be:
> Form:
> 1st Alias Name
> SubForm:
> 2009    124
> 2008    234
> 2007    198
>
> I'm having trouble getting this to work in the subform.
> My question is how do I connect to the select statement in the table and
> return the selected data to the subform?
> Any suggestions would be appreciated.
> Thanks. 


0
Jeff
12/3/2009 4:34:00 PM
Reply:

Similar Artilces:

Display total value on subform
I have a job-costing page for our orders, which is a subform on a tab control linked to all other parts of the database by Ref. The aim is to show all costs, with total, then all revenue, with total, then the profit. The incoming costs are entered here and then stored in a table, no problem. Sales invoices are generated via other forms and I have a query that displays just the basic details for each invoice filtered by Ref so that we see only the invoices raised for that particular current order. These are displayed on a nested subform based on the query. When there are several sales invo...

Using Relative path for XML data file?
Is there a way to specify a relative path to an XML data file imported into Excel 2003? I am writing a web app that generates report data as XML for the user to download to their local machine. This data is to be consumed by an Excel reporting spreadsheet, which contains display-formatted tables and charts that are mapped to various data fields in an XML Map, which is in turn linked to the xml data file they will download. The idea is the user only needs to download the data for updates, not the whole spreadsheet. However, since I cannot predict the path where the user will store their...

Changing Cells and entering data in them
Thanks for the help again. Big thanks to Steve you've got me this far. I went out and bought a book, but it's like reading a foreign language. I was informed today that I can't have message boxes come up. I need to have the code point at the cells and if they are blank turn which ever one is blank red or if both are then both turn red then pause for each cell to be filled in. Cell F14 "Last Name" then automatically go to Cell F16 "First Name" on tab or enter. Basically if Cell F22 or F23 has an X in it, Cells F14 an F16 turn red and cell F14 has the focus...

Formula without using numbers after decimal in the answer
I have a formula that derives the answer from a figure with a decimal. I don't want to use the figures after the decimal. Is there a way to just use the whole number and omit the numbers after the decimal without having to manually key in all these numbers manually? Thanks, Mustang You can use the INT function. This 'rounds down' any number to th nearest integer, e.g. if A1=2.567, a formula in B2 of =INT(A1) return 2 HTH Bruc -- swatsp0 ----------------------------------------------------------------------- swatsp0p's Profile: http://www.excelforum.com/member.php?...

how to convert lookup values to the "display text"
I'm using an sql code (below) which uses a few lookup fields. Unfortunately in the datasheet view, I get the "bound values" instead of the "display values". How can I change the properties for the these lookup fields so I can see the "display values" from the datasheet view? SELECT [Funding],[Date],[Description],[Company],[Expense_Type],[Amount],[Status] FROM [Form_9_Status] UNION ALL SELECT [Funding],[Date],[Description],[Company],[Expense_Type],[Amount],[Status] FROM [TDY_Status] UNION ALL SELECT [Funding],[Date],[Description],[C...

data sort
ok now should be simple >> I need to sort by month on data that is held in format >> day/month so eg 1511 1510 3011 3010 now custom/ends with/ 11... does not work custom/ends with/ ??11.. or *11 does not work either contains 11 does not work (& would also be wrong if data set contained 1011) but still I am stumped so any help would be great cheers Alex I would be inclined to add a new, temporary field of formulas that pull off the right 2 digits, and sort by that: =RIGHT(A1,2) -- Jim Rech Excel MVP ...

Average of absolute values of moving ranges
I'm trying to get the average of the absolute values of a set of data over 8 weeks. Each week is on a seaparate sheet so to capture the moving ranges I've been using the formula below to get my result. Is there an easier way? =AVERAGE(ABS('Week 1'!G2-'Week 2'!G2),ABS('Week 2'!G2-'Week 3'!G2),ABS('Week 3'!G2-'Week 4'!G2),ABS('Week 4'!G2-'Week 5'!G2),ABS('Week 5'!G2-'Week 6'!G2),ABS('Week 6'!G2-'Week 7'!G2),ABS('Week 7'!G2-'Week 8'!G2)) Thanks! Amy The use of t...

Pulling data from separate tabs
When charting in Excel 2002 is there a way to use sets of data from two different tabs within the same worksheet? For example, a spreadsheet contains separate tabs for prior year and current year data. Is there a way to reference the data or label series to pick up data from both? I tried pointing and clicking, and then typing the following as a reference for the axis labels: ='Prior Year'!$B$110:$M$110,'Current Year'!'$B$110:$M$110 but receive an error that I'm referring to an external worksheet. I've used the comma (') in the past to reference breaks ...

default values in a cell
Hello, can you help me please Cell B1 contains a complex mathematical formula which requires (in several places) a number from cell A1. Cell A1 can contain any integer number, but it is usually the same (30). I would like to be able to leave cell A1 empty, and only enter a number when it is not 30 , ie the default value of A1 is 30, unless specified. How do I go about this ? Should I look at conditional formatting, or put lots of IF functions into an already complex formula? Thank as always KK Use 2 cells Modify the complex formula to use B1 rather than A1 ( or any other un-u...

Disable Secure Sockets Layer on exchange server when using RPC over HTTP
Hi im trying to enable RPC over HTTP to enable users to establish contact to my Excahger server 2003 over the internet. Now, I dont want to use SSL (security not that important) and i am told by this article that i can disable SSL in windows registry. Quote: Note While RPC over HTTP does not require Secure Sockets Layer, you must modify the registry to enable RPC over HTTP if you do not want to use Secure Sockets Layer. Microsoft recommends that you enable and require Secure Sockets Layer for your RPC over HTTP communications. At this address: http://support.microsoft.com/?id=833401 But i ...

Pivot Table Question #5
How do I make the row headers show up in front of each row on pivot table instead of just once on the first row of a section? Thanks Try this: Copy the pivot table Do a Paste Special > Values into another sheet Ensure that the top left cell is A1 Run the Sub FillBlanks() below (from MVP Debra D) Sub FillBlanks() 'by Debra Dalgleish 7-Dec-2001 'fill blanks cells with data from above Range("A1").CurrentRegion _ .SpecialCells(xlCellTypeBlanks) _ .FormulaR1C1 = "=R[-1]C" Range("A1").CurrentRegion.Copy Range("A1").PasteS...

'top' is not a valid value for the 'vertical-align' property.
Well, it is, actually, and the resulting .chm file works properly in HTML Help. But it's a bit tedious getting that wrong useless error message from VS2002 on every build. (Well, not every build, it only does it sometimes actually.) Any idea how I can persuade it to stop telling me this? -- Tim Ward Brett Ward Limited - www.brettward.co.uk ...

How to delete a set of rows depending on Value
I have two worksheets Worksheet A 27 Columns 1600 Rows. Worksheet B 1 Column 200 Rows I need Worksheet A to look at each cell in Worksheet B, if a cell exists in Worksheet A, then I need the row deleted... Basically I have a list of Grand list of items to do, then a list of items already completed. I need to now remove all entries in the grand list that have been completed. Is this feasible or should I look at using some Unix script. It sounds like you could use VLOOKUP to find out if the value in B exists on A: http://www.officearticles.com/excel/vlookup_formulas_in_microsoft_excel....

using the journal on outlook
Once I link an email to the journal, can I still find that email in my mail box? I seem to be able to get to it only via the journal. If this is the way it is supposed to be, how do I remove it from the journal and get it back into my mail box? Am I just missing something? -- thanks, Independent Are you linking to the item or putting a copy into the journal item? Also, has the item been archived or not? "Independent" <Independent@discussions.microsoft.com> wrote in message news:868279F2-53C8-403A-97F5-604CEECD873C@microsoft.com... > Once I link an email to the journ...

form fields not saving to table
I have created a database with a form and three of the fields are not saving the information to the table. I have checked the row and control sources and now at a loss and thoughts? As you scroll through existing records is the data of the table displayed? Post the SQL of the query or form source. -- Build a little, test a little. "Kim" wrote: > I have created a database with a form and three of the fields are not saving > the information to the table. I have checked the row and control sources and > now at a loss and thoughts? > > ...

Table of Contents for each section
I have tried several times to create a TOC for each section of my document. They way it is now I can simply go to the Insert a TOC and it will insert e perfect TOC. All my text has been changed to the appropriate Level and I have no problem there. But I need to seperate the chapters to the start of their respective sections (I have next page breaks inserted at the start of every chapter). I have tried the bookmark method, no luck. I have tried other methods but I think my problem is that I have selected the appropriate fields and changed their levels appropriately. I have not mes...

predict future data
Is there a way to create an XY line graph wih plotted data, yet leave room to predict future data on the axes? I can get the graph, but the x and y axes stop at the last data points, and I want those axes continued so that the existing data can be examined and future data predicted and plotted on the same graph, but I am not sure how to accomplish this. Any suggestions would be appreciated. Thanks. Jeff 1) Click on data series in chart, use Add trendline; in Option tab specify some units forward OR 2) Read Help about TREND and FORECAST, and SLOPE and INTERCEPT OR 3) Get crystal bal...

Status in table PurchaseOrderEntryDetail
Hello, We're trying to populate serial # into the PurchaseOrderEntryDetail table and run across the column 'Status'. What are the possible values for Status column in this table? Most of the time we see status of '2'. What does that mean? Please help. Many Thanks & Best Regards, Nikki ...

Let me use the Line Color icon on charts
It would speed up a lot of my work if I could use the Line Color icon on Excel charts, the same way I am able to use the Fill Color and Font Color icons. However, when I highlight any chart object, like the Plot Area, Chart Area, or a Series, the Line Color icon is disabled. -- Stuart Bratesman, Jr., MPP Muskie School of Public Service Univ. of Southern Maine Portland, Maine ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If ...

Call & Place Graphic Based on Cell Value?
Is there any way to call & place a graphic image based upon a cell value? Maybe you can look at J.E. McGimpsey's page: http://www.mcgimpsey.com/excel/lookuppics.html documike wrote: > > Is there any way to call & place a graphic image based upon a cell value? -- Dave Peterson ...

Formula for cross tab data filling
Hi All Excel 2003 How to using formula for data filling as below (Y/N) ? Sheet A Product A Product B Product C System A Y N Y System B Y Y N Sheet B System A Product A System A Product C System B Product A System B Product B moonhkt ...

Does Outlook use the DAV protocol?
I'm an Outlook Express user who wants to switch to Outlook. I received a notice from Microsoft that includes the following: "... as of June 30, 2008, Microsoft is disabling the DAV protocol and you will no longer be able to access your Hotmail Inbox via Outlook Express." Please tell me if this action by Microsoft will affect Outlook in the same manner, or am I free to make the switch. "BudV" <BudVitoff@(NO)att.(SPAM)net> wrote in message news:%230XUDi%23zIHA.2384@TK2MSFTNGP02.phx.gbl... > I'm an Outlook Express user who wants to switch to Outlook...

Help with importing data
Can I have users fill in a form in Access and have that data be transferred and updated to a spreadsheet. Need for fill out several fields and then export to a specific spreadsheet and place that data into the cells that will update that cell (add to the total in that cell) of a spreadsheet. ...

Formula to return non-zero values in a list
I have a list of numbers in a column like so - 2 3 4 1 8 0 0 0 0 What formula would I create to always give me the a SUM of the las couple values before the zero value. The list always ends with a valu other than zero, so in this case, the '8' is the end of the list, and would like to SUM the 3 "last" values, those being 8, 1 and 4. As use this file, the zero values will automatically be updated with ne information, so I need a formula which would constantly reflect thi change -- Message posted from http://www.ExcelForum.com If you don't mind having an extra col...

Reference / Copy Dynamic Data
Have a worksheet listing products and prices for numerous suppliers. eg.: Supplier--Product---Price ABC-------apple-----1.00 ABC-------orange----1.20 XYZ-------brick-----3.40 XYZ-------cement----0.80 This worksheet will change often. What I would like is to reference this information on other worksheets. I would also split the info onto a worksheet for each supplier. Therefore i will have a worksheet for ABC and for XYZ, and the info in these worksheets will change as the main "index" worksheet changes. eg. Worksheet ABC contains: Product---Price apple-----1.00 orange----1.20 ...