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

Home Posts Topics Members FAQ

Requery of Subform with combo box

I have a subform that has a query on another table. One of the fields
is based on the contents of another table. When the user selects one
or other option in the main form I want the the records in the combo
box to show the new selection.

I have tried putting the requery action in many of the events on the
main form but cannot get it to refresh to show the new records. If I
close the form and reopen it or use Records - Refresh on the menu of
course it all updates correctly.

Hopefully this illustrates the problem.

frmMain form - sfrmSubform - qrytblTable - tblTable - RowSource
| ^
| |
Option Group tblRows
| ^
| |
Option buttons----->tblRecordTyp e----------------------->|

Where and how do I place the requery, if that is the way to do it?

Nov 13 '05 #1
1 5331
In the AfterUpdate Event of each option put the following:

Dim Qry as string

Qry = "SELECT * FROM TblName WHERE Condition" (Whatever you want to
select)
ComboBox.Rowsou rce = Qry
DoCmd.Requery "ComboBox"

If you are using Option Buttons put an IF condition to check it the
Option Button's value = -1 otherwise it will check when you deselect
the option too which is not what you want.

Nov 13 '05 #2

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

Similar topics

1
1663
by: Jimmy | last post by:
Does anyone know if refreshing particular row data possible in subform? For example: Subform has two field: Vendor and product In first row, is it possible that when you select a vendor only the products associated with this vendor appears in product field. Go to next row, select different vendor, now only products associated
0
429
by: Michelle | last post by:
Hi all I have a main form which has a combo box and a subform. The two forms are linked by ShiftPatternName which is basically the value in the combo. the combo has the following code Me.RecordsetClone.FindFirst " = '" & Me! & "'"
4
7002
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 user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
0
1174
by: Robert | last post by:
Thanks and would like to use your suggested join approach however tblSub.FieldA is one field of a two field key (2nd key field say FieldB) for tblSub. So need to exclude tblX.fieldAs in the combo box list only where there is a saved record in tbl.Sub with the same tblSub.FieldB Can you help with the join in this case where null case needs to be for both FieldA and FieldB (or a combined field) <pietlinden@hotmail.com> wrote in message...
14
11461
by: Kurt | last post by:
I have an unbound main form with an unbound subform. frmProjects fsubProjectList Using combo boxes, the user can select several search criteria on frmProjects and then click a command button. The command button passes the criteria as a string to a query. A subform, which is based on this query, shows the results of the search.
2
1923
by: cmichaud | last post by:
Previously i had a combo box where i could select a name and then click a button and a subform on that form would requery and give me the information i wanted. However, i have now changed the combo box to a list box...and am having a difficult time integrating the requery feature. in short i have strWhere = " = " For Each varItem In Me.MemberID.ItemsSelected strWhere = strWhere & Me.MemberID.ItemData(varItem) & " OR =
1
3732
by: kimj.dk | last post by:
Hi, I have a form with a subform where the subform uses the value from a combo box on the main form as a query criteria. I don't want the subform to update or get data before the user has selected a value in the combo box because the subquery takes a while to update. Is it possible to disable the subform to update when the form loads? Best regards, Kim
1
1437
by: kaleshire | last post by:
I have a form that has two combo boxes which are used to find a record for the subform. An AfterUpdate event on the second combo box runs ... Me.vtrack.Requery this part works perfectly, and when no record is found, of course nothing populates the subform. When nothing populates and I type in information to the subform and Save/Close the form, no record is created in the subforms table. I'm trying to find a way to have the subform start a...
6
7984
by: MarkoBBC | last post by:
Hi everyone, First a brief description of my form: I have a subform within a main form. In my subform, I have a listbox displaying address information by firm name. A user first has to select a firm name in a combo box above the list box. The listbox and the combo box join on firm name. The listbox records what address was selected in the address table by the way of an address id number. I set up a macro to requery the listbox when you...
5
8111
by: ApexData | last post by:
I have a ComboBox, when dblClicked, displays the combobox's row content in a continuous subform. Changes can be made to this content in the subform and then closed. The ComboBox needs to be requeried to immediately reflect these changes. The problem is that I can't requery in the OnDblClick event of the ComboBox because the event completes once the subform is launched. I guess I could requery the combobox from the Close event of the...
0
8332
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
8851
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
8627
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...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2750
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
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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.