473,466 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Row Source Query in Navigation Subform

33 New Member
Hi all,

I have a combo box the row source of which refers to the value of another control.


It works completely fine in the form itself, written as
Expand|Select|Wrap|Line Numbers
  1. SELECT distinct TBL_PROTOCOL.[PROTOCOL NUMBER] FROM TBL_PROTOCOL WHERE (([STUDY NAME]=Forms.FRM_PROTOCOL.SetStudy)) ORDER BY TBL_PROTOCOL.[PROTOCOL NUMBER];
but when the form is accessed via the navigation subform that users will use to access it, it stops working, and instead prompts me for a value of Forms.FRM_PROTOCOL.SetStudy.


I've tried changing the where statement to
Expand|Select|Wrap|Line Numbers
  1. [STUDY NAME]=Forms!NAV_DATABASE.NavigationControl0.FRM_PROTOCOL.Form.SetStudy)
per what I've read on the web, but the problem persists


Can anyone tell me how I need to tweak the syntax to allow this to work in the overall navigation structure?

Thanks!!
Apr 8 '16 #1
6 1635
NeoPa
32,556 Recognized Expert Moderator MVP
If it's in SQL then using dots (.) is wrong as they won't be recognised. I don't know where the data is relative to your form but assuming you have that right, then changings dots to bangs (!) should fix it.
Apr 9 '16 #2
abcrf
33 New Member
Unfortunately, it doesn't. And thinking back, there have been many times in the past I've used dots in the row source without problems.
Apr 12 '16 #3
NeoPa
32,556 Recognized Expert Moderator MVP
I'm afraid you're right. Even trying to duplicate that in VBA fails, but in a query it resolves [Forms].[FormName] as if it were [Forms]![FormName].

"Well, I'll be!" as they say.
Apr 12 '16 #4
NeoPa
32,556 Recognized Expert Moderator MVP
Looking at your code, it seems that your reference within the form is quite different from your posted WHERE code. Can you explain what the structure is you're working with. I find it particularly curious that the reference within the form has FRM_Protocol as a form found in the Forms collection, whereas the other reference appears to treat it as a sub-form control.

An explanation of the types of each of the objects involved would help to make the question clearer.
Apr 12 '16 #5
abcrf
33 New Member
Yeah, it was written as such because FRM_PROTOCOL is a form being accessed within a navigation subform.

What I ended up doing was pulling the value of the first combobox directly in VBA, and setting the rowsource of the second with that value:

Expand|Select|Wrap|Line Numbers
  1. Me.SetNumber.RowSource = "SELECT distinct TBL_PROTOCOL.[PROTOCOL NUMBER] FROM TBL_PROTOCOL WHERE (([STUDY NAME]=""" & Me.SetStudy.Value & """)) ORDER BY TBL_PROTOCOL.[PROTOCOL NUMBER]"

Works fine. That's what I get for trying to use the Microsoft interface...
Apr 13 '16 #6
NeoPa
32,556 Recognized Expert Moderator MVP
abcrf:
That's what I get for trying to use the Microsoft interface...
I suspect there is a way to use the Microsoft interface, which would be a valid answer to the original question, but I'm afraid I don't have experience with such controls, nor a database to play with which can sometimes be enough.

Anyway, well done for finding a way around the problem.
Apr 13 '16 #7

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

Similar topics

1
by: Richard | last post by:
Thats a mouthfull of a title what I'm after should be really simple. I have a form with a subform which itself has a subform the final subform contains an individuals record. The individuals...
1
by: Jean | last post by:
Hi, I think this is quite a simple one: I have a ComboBox, where the source is a stored query. When I click the drop-down arrow on the Box, it takes awhile. I want to run this query in the...
1
by: Holmsey | last post by:
Hello All, I am creating a database form that has 5 tabs, with each tab holding a subform. On the first tab I want to Highlight certain words that appear in one of the subforms. The words I am...
3
by: RookieDan | last post by:
MS ACC 2003, WS. In the subform i have query showing the results according to this SQL. It shows (grouped) number of customer data belonging to a specific dealer/vendor has in a related table. ...
6
by: Michael R | last post by:
Please help me with this. I have a form in which I would like to present results from a CrossTab query in a subform. I don't need the query to be bounded to a master field. Also, I have a...
3
by: russellhq | last post by:
Hi, I'm fairly new to access and have a little trouble with a crosstab query I've setup. I have a main form where the user selects a project name and below in a subform, a crosstab query is...
23
by: mforema | last post by:
Hi everybody, I need to create a query that will search based on keywords and major categories. My tables are set-up as follows: tblLiteratureArticles: Abbreviation(FK) ArticleID(PK) Author...
1
by: nagileon | last post by:
Hi there The code is working fine but I don't know how to show the output of: "select count(leads.id) from leads". I did put the "Subform/Subreport" control on the Form but have no idea what...
0
by: Kassimu | last post by:
Hi all, I have a table which has a subdatasheet. I need to create the query that will have additional field(s) for each record in sub datasheet. How can I create such a query? To bring in the...
3
by: hvsummer | last post by:
Hey guy, I'm back with 24hours stress question. I finished building the core of my project, now I start to make GUI with navigation form....
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.