473,668 Members | 2,357 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

refering to a subform control

Main form-frmCheckRequest
Sub form-subfrmCheckRequ estPayments

On my subform I have 2 fields FundCode and ClassNumber. Both are comboboxes.
I'm trying to filter ClassNumber based on FundCode.

When I create a separate query it returns the records I expect based on the
record I select in the subform. Here's the query code.

SELECT dbo_FundClasses .ClassNumber, dbo_FundClasses .FundCode
FROM dbo_FundClasses
WHERE
(((dbo_FundClas ses.FundCode)=[Forms]![frmCheckRequest]![subfrmCheckRequ estPa
yments].[Form]![FundCode]));

When I set the rowsource of ClassNumber to the same query I get the same
records no matter which subform record I select. The list presented is
always being filtered from the first subform record even if I select another
record with a different fundcode.

Any ideas?
Nov 13 '05 #1
4 1337
Terri wrote:
Main form-frmCheckRequest
Sub form-subfrmCheckRequ estPayments

On my subform I have 2 fields FundCode and ClassNumber. Both are comboboxes.
I'm trying to filter ClassNumber based on FundCode.

When I create a separate query it returns the records I expect based on the
record I select in the subform. Here's the query code.

SELECT dbo_FundClasses .ClassNumber, dbo_FundClasses .FundCode
FROM dbo_FundClasses
WHERE
(((dbo_FundClas ses.FundCode)=[Forms]![frmCheckRequest]![subfrmCheckRequ estPa
yments].[Form]![FundCode]));

When I set the rowsource of ClassNumber to the same query I get the same
records no matter which subform record I select. The list presented is
always being filtered from the first subform record even if I select another
record with a different fundcode.
What I would do is copy the SQL code and paste it into a new query.
Query/new/design/close/viewsql and paste. Now open the form. now get
to the query and attempt to open/run. If it blows up, it will show you
where it does.

I'm not sure the .[Form] is necessary. I might do something like this

Dim strSQL As STring
strSQL = "SELECT ClassNumber, FundCode " & _
"FROM dbo_FundClasses " & _
"WHERE dbo_FundClasses .FundCode = " & _
[Forms]![frmCheckRequest]![subfrmCheckRequ estPayments]![FundCode]

Me.ComboNameInY ourForm.Rowsour ce = strSQL

I'll assume FundCode is a numeric value, otherwise you need quotes.
"WHERE dbo_FundClasses .FundCode = '" & _
[Forms]![frmCheckRequest]![subfrmCheckRequ estPayments]![FundCode] & "'"

Any ideas?

Nov 13 '05 #2
What I would do is copy the SQL code and paste it into a new query.
Query/new/design/close/viewsql and paste. Now open the form. now get
to the query and attempt to open/run. If it blows up, it will show you
where it does.
When I copy into a new query I get my expected results. I switch between
subform records and the separate query works fine.

I'm not sure the .[Form] is necessary. I might do something like this


It doesn't seem to be necessary but removing this does not solve the
problem.

Thanks for your reply

Nov 13 '05 #3
If I put a refresh on the OnCurrent event of the subform it works. Is this
normal?

"Terri" <te***@cybernet s.com> wrote in message
news:dd******** **@reader2.nmix .net...
What I would do is copy the SQL code and paste it into a new query.
Query/new/design/close/viewsql and paste. Now open the form. now get
to the query and attempt to open/run. If it blows up, it will show you
where it does.


When I copy into a new query I get my expected results. I switch between
subform records and the separate query works fine.

I'm not sure the .[Form] is necessary. I might do something like this


It doesn't seem to be necessary but removing this does not solve the
problem.

Thanks for your reply

Nov 13 '05 #4
Terri wrote:
If I put a refresh on the OnCurrent event of the subform it works. Is this
normal?
I don't know. I usually requery. But if it works, that's what's important.

"Terri" <te***@cybernet s.com> wrote in message
news:dd******** **@reader2.nmix .net...
What I would do is copy the SQL code and paste it into a new query.
Query/new/design/close/viewsql and paste. Now open the form. now get
to the query and attempt to open/run. If it blows up, it will show you
where it does.


When I copy into a new query I get my expected results. I switch between
subform records and the separate query works fine.

I'm not sure the .[Form] is necessary. I might do something like this


It doesn't seem to be necessary but removing this does not solve the
problem.

Thanks for your reply


Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3294
by: David B | last post by:
I have a sub form in datasheet view on a form. I want a query to find the recordid every time a different row on the datasheet has the focus. The query is grabbing data for a combo on a second sub form. Any thoughts ? TIA David B Hexham UK
25
10222
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
12
19006
by: MLH | last post by:
I have created two forms: frmBrowseNegsMainform and frmBrowseNegsSubform. I put a subform control on the first of these. The SourceObject property for the subform control is, of course, frmBrowseNegsSubform. I would like to perform an ascending or descending sort on any of the 7 columns shown in datasheet view in the subform control. I've been unsuccessful. Is there something tricky about sorting in subform controls?
3
1835
by: Kranman | last post by:
Hi All, Love this site, have gotten a lot from it. This is my first time posting though, so forgive me for any errors. I have an Access 2000 db where I have a main form of Contractors and on the main form is a subform of bonds carried by those contractors. I am trying to reference a field named "Bond" located on the subform in code that is run from the mainform and am having trouble with the syntax for this. Below is a sample of...
4
1717
by: rhc | last post by:
access 2000 I have a tab control with 2 pages and one subform on each. On parent form P from the form_current() event of subform A I cant seem to refer to subform B. msgbox forms!.form.name works
6
5967
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few forms in the database that will use this function, so I need to be able to tell the code which form to unlock. What I have is as follows: Public Function akeyEdit()
7
12299
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm thinking the Table will stay open otherwise ??? - Do I also need to use code to Assign the Child&Master Links, or can I just type the names into the subForms Control Property and just depend on the SourceObject to link to Table???
5
3637
by: CanOfWorms | last post by:
Access 2003 (previous 2000) Windows XP Pro I am fairly new at VBA within Access, learning as I go thorugh forums and discussion groups. I generally find my answers through previous posts, but I have been unable to find how to specifically refer to properties within a graph object. Below is a snippet of code from my module in which the graph ('chart_DataSet') is in a subform ('frm_sub_Chart') that is contained within a control...
1
3242
by: veteranwebdesign | last post by:
Hello, I have a main form. I want forms to open in a subform control box. What is the code for the option group to open the subforms in the control box. I didn't create subforms, I created regular forms, but will create subforms if that is needed for this to work. My main goal is when a user clicks on a menu item and comes to a main
0
8374
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8890
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8791
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8575
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8653
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4202
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2784
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.