Criteria for opening a form based on a value in another form's subform

Hello everyone, 

Please pardon the noob question, but I've got a form with a subform and I
would like to be able to open another form with only the records that match
the primary key from the first form's subform, but I am unable to figure out
how to specify that value in the query. In other forms (where subforms are
not invovled), I can accomplish this with something like:

=[Forms]![Form_Name].[Desired_Value]

Is there something different I need to be doing when attempting to get a
similar value from a subform?

With many thanks in advance for any advice...

-- 
Message posted via http://www.accessmonster.com

0
seaton
7/10/2007 9:31:26 AM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
1396 Views

Similar Articles

[PageSpeed] 31

Subforms are not open in their own right, so you have to refer to them 
through the main form.

To refer to Text0 on subform MySub of main form MyMain, use:
    [Forms].[MyMain].[MySub].[Form].[Text0]

Explanation in:
    Referring to Controls on a Subform
at:
    http://allenbrowne.com/casu-04.html

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"seaton via AccessMonster.com" <u22108@uwe> wrote in message
news:74f4f49d3b6e9@uwe...
>
> Please pardon the noob question, but I've got a form with a subform and I
> would like to be able to open another form with only the records that 
> match
> the primary key from the first form's subform, but I am unable to figure 
> out
> how to specify that value in the query. In other forms (where subforms are
> not invovled), I can accomplish this with something like:
>
> =[Forms]![Form_Name].[Desired_Value]
>
> Is there something different I need to be doing when attempting to get a
> similar value from a subform? 

0
Allen
7/10/2007 9:53:59 AM
Excellent! That worked perfectly. 

Thank you very much, Allen, you made my day!

That's a very useful site you've got there, by the way. 

Allen Browne wrote:
>Subforms are not open in their own right, so you have to refer to them 
>through the main form.
>
>To refer to Text0 on subform MySub of main form MyMain, use:
>    [Forms].[MyMain].[MySub].[Form].[Text0]
>
>Explanation in:
>    Referring to Controls on a Subform
>at:
>    http://allenbrowne.com/casu-04.html

-- 
Message posted via http://www.accessmonster.com

0
seaton
7/11/2007 12:40:54 AM
Reply:

Similar Artilces:

Multiple criteria #3
I was looking for help with the following code. I would like to count the agents hired after 2002 and were hired directly Dim hiretype As Text Dim agntct As Integer Dim dbs As Database, rst As Recordset hiretype = "Direct" agntct = DCount("[Agent Hire Date]", "tblAgentdetail", "[Hire Type]= '" & hiretype & "' and [Hire Date]> #12/31/2002# ") ' Return reference to current database.D Set dbs = CurrentDb ' Open table-type Recordset object. Set rst = dbs.OpenRecordset("TestAG") rst.AddNe...

get random record in form
I have prepared a online test portal in MS access for 25 users. Users login & they give test. All of them access same question master and receive questions in their respective forms. What i wish to do is i wish that every body gets records in random manner. Idea is every body needs to solve ten questions from the question master but the sequence should be different for all. Can we do it using query or we need to write some macro.. Hope the problem is clear.. Kinldy help.. thanks a lot.. Boss hi, Boss wrote: > What i wish to do is i wish that every body gets records in ran...

computing formula according to criteria #3
Thanks, That's a good idea, the problem is I have several participants, and need a template sheet where I can just paste each participant's data and the means and SD's will be computed automatically. At the momen going over each and every participant is taking me hours. I really need a formula... -- lior ----------------------------------------------------------------------- liory's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1049 View this thread: http://www.excelforum.com/showthread.php?threadid=26138 another way to do it would be to write a ...

Use horizontal column titles in list box (VBA form)
Hi. I have a sheet with 10 data columns with titles like product id, product name, stock, price etc. I have named the range of titels col_titles. When I try to assign col_titles as the Row source of a list box in a VBA form, the titles will not show in a list, but appears when I set the colum count to 10... Is there a easy way to transpose a named range, so it will fit as a Row source for a list box? Alternative, could anyone give me the correct VBA code to popultae a listbox based on a horizontal "array" of column titles in a sheet? Any hints appreciated Kind regards Mr. S...

excel wont open file #2
I am trying to open a excel file, but a message comes up saying th file is corrupt ,is there anyway i can open i -- Message posted from http://www.ExcelForum.com ...

Open multiple file cause excel to freeze
Hi all I'm using several files each using external links to applications like Reuters 3000 Xtra and Bloomberg. When I open each files separatly, I'm asked to refresh the links and the file opens without problem. If I open two or three of this file, Excel freezes on the opening of the last one. I have to kill the process in order to close Excel. These files are used by many of my users, some have Reuter and Bloomberg, some have only reuter or Bloomberg, and some have none. Here is what I noticed : There are freezes only if the user does NOT have Bloomberg installed, but, there...

DMAX with Criteria
Is there a way to add criteria to the expression that creates my serial numbers? Me![TxID] = Format(DMax("[TxID]", "[tblMyTable]") + 1, "0000") I want the next number in the series to be based on a category field on the form. which will be matched to a ctegory field in MyTable. In other words: The user allocates the record to a Category and clicks a button to return the next available number in the series for that category. This will result in duplicate numbers in the Seriel Number Field, but this is not my Primary Key, (I am using an Autonumbe...

Menu on my dialog based application.
How do i attach a menu to my dialog based application? Bredal, You create a menu and add it to the dialog in the resource editor - the Dialog Properties box, General tab, Menu dropdown. Johan Rosengren Abstrakt Mekanik AB "Bredal Jensen" <Bredal.Jensen@mimosa.com> a �crit dans le message de news:uaoAY9ulEHA.3428@TK2MSFTNGP14.phx.gbl... > > How do i attach a menu to my dialog based application? > > Whilst this adds a menu, as it stands you do not get those handy OnUpdate...()'s for your menu items. See http://support.microsoft.com/default.aspx?scid=k...

Adding a field from another table on a form
I'm trying to add a field to my master form from another table. I created a relationship between the master table and the other table, but even after I've updated the control source to = [table]![field] all of the results are showing as "#Name?" . I know I'm doing something silly, please help me. To add a field it needs to be in the report's Record Source. Use a query rather than a table. However, a query based on related tables may not be updatable. You have provided few details, so it is difficult to be specific, but typically a subform is used t...

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? > > ...

HOW CAN I VIEW MY OPENED DATA. IT'S OPENED BUT DOESN'T APPEAR
I was workign with my data when it went off from the screan. Main while it shows that it's opened. I tried to print it and it printed but still can't see it on the screan. Please I need help. How were you viewing it? In a table or query or report? "yaw" wrote: > I was workign with my data when it went off from the screan. Main while it > shows that it's opened. I tried to print it and it printed but still can't > see it on the screan. Please I need help. ...

Form
Hi, I am now dealing with a CFormView program (MFC), but I want to take full control of the it. So If I was to say I want to create a Win32 application, is it possible to create a form on it just like the formview said eariler? Thanks Jack I also appreciate the look of a DX Wizard generated application where you can switch full screen and windowed at will. But is it a tedious job to work from nothing? Thanks Jack "Jacky Luk" <jl@knight.com> ���g��l��s�D:eh4s$kKPFHA.3076@TK2MSFTNGP12.phx.gbl... > Hi, > I am now dealing with a CFormView program (MFC), but I want ...

Security warning upon opening database
Access Newbie here using Access 2003. Every time I open my database file, I get a "Security Warning" dialog box saying "This file may not be safe!" Very annoying. Can it be turned off? James Ivey Just go: tools->macro->secuirty if you set it to low..you not see any prompts... -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada pleaseNOOSpamKallal@msn.com Check http://www.accessmvp.com/JConrad/accessjunkie/macrosecurity.html -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "James Ivey" <nope@no...

Word 2007 crashes on opening
recently MS Word frequently crashes as soon as the app is opened, and only by shutting down Windows and restarting am I able to get the program stable. The error dialogue is as follows: Fault Module Name: StackHash_3c89 See http://word.mvps.org/FAQs/AppErrors/ProblemsStartingWord.htm. -- Stefan Blom Microsoft Word MVP "ajaxt" <ajaxt@discussions.microsoft.com> wrote in message news:78256ACC-7DBF-4AD9-90C6-767888A8D8A8@microsoft.com... > recently MS Word frequently crashes as soon as the app is opened, and only by > shutting down Windows and restart...

AND on 2 fields along with other criteria in query
Hello New to Access and trying to figure out a problem with an AND test I have a database with 4 fields called A B C D Field A Must =1 (no problem with this) Field D Must > 1 (Again no problem) Fields B & C can be any number including zero, as long as BOTH fields are not zero. If I search using the criteria for fields A & D only, I find 390 records. If I search with criteria that says show me if both are zero, (B=0, C=0 on the criteria line, along with the other criteria) it shows me the 4 or so suspect records that have a zero in BOTH fields. If I use the opposite, and...

Can I highlight a cell and link it to another workbook?
I need to highlight one cell and link it to another cell in a different workbook where I want to enter a text definition of the first cell. I don't think linking works because that just gives me the same information in a different cell. I want to be able to click on a cell in one worksheet and be able to "flip" to its definition in another worksheet. Thanks! -- Jenn Create a hyperlink... Click the cell you want to link so it is the active cell. Go to the Insert menu and choose 'hyperlink' In the hyperlink window select the 'Place in this Document' button...

"message opened"
Is there any way to disable the exchange 2003 server to send "message opened" and "message delivery" mail out on the internet? //RO In Exchange 2000 it was possible, but you needed to write your own SMTP sink. I don't know if the feature is allready added to exchange 2003, but you might want to take a look at the following site: http://www.vamsoft.com/orf/howto-readreceipt.asp "Scotty44" <scotty44@hotmail.com> wrote in message news:OPKD97EZEHA.3432@TK2MSFTNGP10.phx.gbl... > Is there any way to disable the exchange 2003 server to send "mes...

Part of the form is not printed. Why ?
Hi ! I'm using MS Access 2003 and Windows XP Professional. I have a form with a print button on it. Pushing the button is to print the current record as it is being displayed in the form. And largely it does so. However, there is also a tab control on the form. On the tab control there are subforms that display further data. These data are not printed. What's going wrong ? Your kind help will be greatly appreciated. Peter > > What's going wrong ? I'm going to let you in on a little secret that will help prevent from winding up in a room with padded walls and p...

Open HTML in Excel
when opening the following html in Excel, the first <td> actully was converted into 3 excel cell. is there any way I can force them into one cell? so that each <td> got converted exactly into one cell no matter what html text inside <td> <table> <tr> <td > Column 1 <li> item #1 <li> item #2 </td> <td > Column 2 </td > </tr> </table> warren.wang@csfb.com shared this with us in microsoft.public.excel.misc: > when opening the following html in Excel, the first <td> actully > was converted into...

Wht can't I open Excel files from Sharepoint any more?
I'm running Office 2007 and IE 2008 on a Windows 7 pc at home. Ever since the last round of Windows/Office updates was installed (1/13), I haven't been able to open Excel files from my company's Sharepoint site. MS Word files open ok, but when I try to open Excel files, nothing happens. There are no error messages to give me a clue. Everything worked fine until that last automatic update. The other people I work with use Vista or XP and aren't having this problem, so it's obviously a Windows 7 issue. What happened? And how can I fix it? Hi I am no expert but...

file not opening
I am running Windows XP and excel 2002. I double click on a file and it opens excel, but not the file. Knowing about computers I went to folder options to see if something changed the file type. I open up the xls extension and see new, open, print, printto, & scan for viruses. Open is set to default. When I edit open aplication used to preform action: "C:\Program Files\Microsoft Office\Office10\EXCEL.EXE" /e use dde box is checked dde message: [open("%1")] application: excel dde aplication not running: empty topic: system Try Tools / Options / General / ...

SFO CRM form buttons
Hello all, I've got a client that is experencing a strange problem. The CRM bottons on the top toolbar now display Exchange forms; not CRM forms. I installed a new SFO client and the new install had the same problem. Any ideas? Thanks, Caleb This sort of odd-ball loss of functionality can be caused by the forms cache becoming corrupted or the crmaddin.dll file becoming corrupted. A trick to fix this is to clear the cache for each of the forms. This may not have been done fully by reinstalling. Clearing the cache is done in Outlook by choosing Tools > Options > Other (ta...

Form for choosing report options
This is a somewhat philosophical question. I have a rather complicated form in an issues database that users can employ to generate a custom report. There's an option group that allows the user to choose a detailed or list-format report (this option determines which report is opened); there are four combo boxes that allow the user to filter the issues to show only a set of data (by issue originator, by issue owner, and by two levels of department information), and finally, there are start and end date fields for the report (and an option box to specify if you want to filter by date opened,...

open source alternatives to MSMNY for windows?
Hi all. Is there any decent OS or free alternative to MS Money for windows? I've only found GNUCASH, but is for *nix, and some low quality Java apps. I'd like to found out. tnx to all, JK I'd certainly be interested in this too. If I could do everything that I can do in Microsoft Money on Linux, I'd probably throw Microsoft Windows in the trash completely on my main PC. -Jeff "jan_k" <nospam@nospam.never> wrote in message news:Xns942D8D5D7D5Avisor@193.70.192.192... > Hi all. > Is there any decent OS or free alternative to MS Money for windows? I'...

Create a list with multiple criteria
I have a data base with 1,000's of addresses w/zipcodes (Sheet 1 columns A to E, E being zipcodes). After setting a base address I get all of the zipcodes within a given radius (in this case 70 zipcodes), listed in Sheet 2, Column A. Next, I use COUNTIF (in column B) to find how many addresses are in each zipcode, in this example there are 46 addresses within the 70 zipcodes. What I want to do is create a list in sheet three that will list each with the data from Sheet 1 columns A to E). Any help would be appreciated. Ronbo ...