473,387 Members | 3,750 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,387 software developers and data experts.

Query on the basis of form & bound sub-form

12
In ms access 2007, I have a form & a sub-form bound to the form. Also I have a query having fields from the form & the sub-form.One Text Box in the sub-form has primary key and Id to relate the entire record.
I need to show the filtered data in the Query only which in the form & the sub-form. I have a command button with onclick event to open the Query with filtered data as per the form & the sub-form.
I have tried to put the criteria in the Query as [Forms]![FormName].[TextBox] or [Forms]![Sub-FormName].[TextBox] or[Forms]![FormName]![Sub-formName].[TextBox]
But When I click the button, it pops up=> [Forms]![FormName].[TextBox] seeking the value of the Text Box...... When I put the value of the Text Box there, it opens the filtered data in the Query.
Kindly help me how to generate the Query as per the data in the form & sub-form.
(Lastly I like to humbly inform that I know nothing about access & vba. So far I have tried on the basis of knowledge shared by philanthropic people like you in the forum. Kindly forgive me If I don't use exact terms to describe.)
Thanking all in antecepation
Nov 19 '16 #1

✓ answered by PhilOfWalton

The way to refer to a Text Box on a subform is:-

Forms!FormName!SubFormName.FORM!TextBox

You were close, but missed out the .FORM (Capitals are not needed)

Phil

2 775
PhilOfWalton
1,430 Expert 1GB
The way to refer to a Text Box on a subform is:-

Forms!FormName!SubFormName.FORM!TextBox

You were close, but missed out the .FORM (Capitals are not needed)

Phil
Nov 19 '16 #2
nndkol
12
Thanks Phil for your kind response.
Your suggestion solved the issue.
Also I tried [Forms]![FormName]![Sub-formName]![TextBox]- it works
Thanks again. Regards
Nov 20 '16 #3

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

Similar topics

2
by: William Wisnieski | last post by:
Hello Everyone Access 2000 Looking for some suggestions and advice on how to proceed with this. I hope its not as complicated as it seems to me right now. I've got an unbound main form...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
7
by: J-P-W | last post by:
Hi, in the past I've spent ages writing VB routines to get around this problem, is there a simple way? I have three tables for a membership system: tblMembership - MembershipNumber; Names etc...
1
by: jeffro | last post by:
I have a database used for recording survey data. In the database, I have a form that displays a survey participant and a subform that is filled in by selecting a question from a looklist and...
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my...
9
by: saddist | last post by:
Hello, I just can't get thru it. I have a form and a subform in it. Subform is tabular and it displays a query(Id,name,date). In main form I have text field "enterDateFrom" and "enterDateTo". I...
3
by: wquatan | last post by:
Hi I have a Form with a SubForm The Form is bound to a Query, and is used for navigation. In the event Form_Current there is : wrkField = Me!TableField SubForm.requery
7
by: PotatoChip | last post by:
Ok, I have a form and a subform. The form shows a document with it's pertinent information. The subform has some of the same fields as the form and shows where the document was sent. The main form...
9
by: Ledmark | last post by:
Hello - I've made a form with a subform of the same table, which is for Dr's notes. On the subform I have the query sorting in decending order and a criteria to enter a patient's name so the last...
27
by: tragaz | last post by:
Hi There, I'm a beginer in Access and VB. In my Database, I've got a form with a subform. the subform is a query from a table different than the table of the main form. those tables don't have a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.