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

how to reference active record in subform list into a query

I think I'm close on this one but just need a bit of help! I have a subform that has the results of a query listed in a table view. I want the user to be able to click on a record and have that feed the information of that record to a query that will ultimately output to a chart.

I thought putting the Me! reference at the beginning of the location string would do it but it's not working.

Here's what I have so far...

ANn ideas???
Expand|Select|Wrap|Line Numbers
  1. IIf(IsNull([me]![Forms]![SubformExistingJCodes]![JobCode]), [EEDATA.JobCode]=[EEDATA.JobCode] Or IsNull([EEDATA.JobCode]),[EEDATA.JobCode]= [me]![Forms]![SubformExistingJCodes]![JobCode])
  2.  
  3.  
Nov 8 '07 #1
7 5134
MMcCarthy
14,534 Expert Mod 8TB
I'm not 100% sure what you are doing ...

The syntax is all wrong not just for referring to the subform but also for your IIF statement. Can you outline in detail exactly (using form and control names) what you are trying to do here.
Nov 8 '07 #2
I have a form called FRMMAIN with combo boxes that sends values to a query qryexistingjcode that then displays the results (in tabular format) in a subform called subformExistingJCodes. -This part works fine and I've used the code below (minus the me! reference) to populate the qryexistingjcode query.

I want the end user to be able to click on a row in subformExistingJCodes and have the data contained in the JobCode field of that row passed to a query qryChartSals that looks for matches in the EEDATA table.

Expand|Select|Wrap|Line Numbers
  1.  (IsNull([me]![Forms]![SubformExistingJCodes]![JobCode]), [EEDATA.JobCode]=[EEDATA.JobCode] Or IsNull([EEDATA.JobCode]),[EEDATA.JobCode]= [me]![Forms]![SubformExistingJCodes]![JobCode])
  2. Condition: <>False
  3.  
  4.  
Nov 8 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
I've read your post a number of times and I'm afraid I can't make any sense of it.

None of what you're saying seems to be anything that can possibly work in Access or SQL. The SQL statement you say you are using and that it is working is confusing me because the syntax is all wrong.

Can you start from scratch and post clearly what you have where and what its doing?
Nov 9 '07 #4
OK, I posted a screen shot at the link below which should help things.

http://raddrummer.spaces.live.com/default.aspx
The user makes selections from the 3 combo boxes at the top of the screen which then pass parameters to a query that filters the recordset in subform (shown in table-like format).

You can see that the user has selected the row containing Manager, Catecories 3. What I want to do is have that (current) row's information passed to a query so I can display a chart on things related to that job.

I'm thinking the chart wouldn't be in a subform.

The problem I'm having is getting the correct syntax to reference the current record in my subform.

Does that make sense (hopefully)?
Nov 13 '07 #5
MMcCarthy
14,534 Expert Mod 8TB
To reference the current record all you need is the subforms on current event.

Not sure what you want to pass from the record and to what query but you can reference the current record by putting your code in the subform Form_Current() event.

If you have a query and just want to set criteria based on records in the subform you can do so by setting the criteria to controls on the subform

WHERE EEO =[Forms]![MainFormName]![SubformObjectName]![EEO]
Nov 13 '07 #6
M,


Thanks so much! You're the best!!!

Rad
Nov 14 '07 #7
MMcCarthy
14,534 Expert Mod 8TB
M,


Thanks so much! You're the best!!!

Rad
You're welcome.
Nov 14 '07 #8

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

Similar topics

2
by: Kelly | last post by:
I have a subform that display requisition information. One of the fields in the subform is a combo box that shows who requested the requisition. The users can change who requested the requisition...
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...
1
by: kkrizl | last post by:
I have a form that displays general information about an alarm permit location. There's a subform that shows detailed information about burglar alarms that have gone off at the location. When a...
7
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.