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

Home Posts Topics Members FAQ

Requery Sub after update of another sub both on an unbound form

I have a unbound form with 2 subforms. It looks something like this

_______________ _______________ _______________ __
| [Main} (Some Controls) |
| |
|______________ _______________ _______________ _|
| [Sub 1] | [Sub 2] |
| | |
| AIKey Other Data | Detail |
| AIKey Other Data | Detail |
| AIKey Other Data | Detail |
| AIKey Other Data | Detail |
| AIKey Other Data | Detail |

| | |
| | |
| | |
| | |
| | |
| | |
| | |
|______________ _______________ __|____________ _|

BY setting the Control Source Property to a SQL Statement I'm able to
get the correct values in each Subform. Sub 2, when it loads, looks at
the AIKey value and pulls the correct detail. The initial display
operates exactly like I want. The problem is when I go to the next
record in [Sub1], [Sub 2] doesn't update. If I manually select a field
in [sub 2] and do a Shift+F9 the field updates. Ok, I think, all I have
to do is a requery of [Sub 2]. I can't for the life of me figure out
how to do that through a Macro and any attempt in VBA seems to meet the
same fate.

Before someone asks... This form is read only. It is used to get an
overview of the status of "action items" .

Any Help would be appreciated!
Chris
Nov 13 '05 #1
1 1969
Chris Belcher <ch******@bells outh.net> wrote in message news:<9r******* *********@bigne ws1.bellsouth.n et>...
I have a unbound form with 2 subforms. It looks something like this

_______________ _______________ _______________ __
| [Main} (Some Controls) |
| |
|______________ _______________ _______________ _|
| [Sub 1] | [Sub 2] |
| | |
| AIKey Other Data | Detail |
| AIKey Other Data | Detail |
| AIKey Other Data | Detail |
| AIKey Other Data | Detail |
| AIKey Other Data | Detail |

| | |
| | |
| | |
| | |
| | |
| | |
| | |
|______________ _______________ __|____________ _|

BY setting the Control Source Property to a SQL Statement I'm able to
get the correct values in each Subform. Sub 2, when it loads, looks at
the AIKey value and pulls the correct detail. The initial display
operates exactly like I want. The problem is when I go to the next
record in [Sub1], [Sub 2] doesn't update. If I manually select a field
in [sub 2] and do a Shift+F9 the field updates. Ok, I think, all I have
to do is a requery of [Sub 2]. I can't for the life of me figure out
how to do that through a Macro and any attempt in VBA seems to meet the
same fate.

Before someone asks... This form is read only. It is used to get an
overview of the status of "action items" .

Any Help would be appreciated!
Chris


In the Form_Current() code of subform1 I have:

Call Form_frmMain.Re querySubform2(C Str(Me.IdIDO))

Then in the frmMain code:

Public Sub RequerySubform2 (strIdIDO As String)
'Set visible = false and make visible to keep subform OnCurrent from
running when the main form first opens
If Subform2.Visibl e = False Then
Subform2.Visibl e = True
Exit Sub
End If
Subform2.Form.R ecordSource = "SELECT * FROM tblIDOItems WHERE IdIDO =
" & strIdIDO & " ORDER BY IdItem;"
Subform2.Form.R efresh
Subform2.Form.R epaint 'this line may not be needed
If Subform1.Form.M aterialProcesse d = True Then
Subform2.Form!P rocess.Locked = True
Else
Subform2.Form!P rocess.Locked = False
End If
End Sub

I don't remember why I did it this way, but it worked.

James A. Fortune
Nov 13 '05 #2

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

Similar topics

2
4077
by: David B | last post by:
I am populating an unbound text box from datepicker calender. After the date has been selected I need the sub form to requery. If I manualy put a date in the text box the after update works fine however it does not when the date comes from the date picker form. Where do I need the requery line in this situation ? David B Hexham UK
0
1207
by: N. Graves | last post by:
I have not been successful with updating a query for a sub form of a tab control of a sub form of a form. Basically I have a form that has a combo box to select an equipment record and on this record I have owner and backup owner. These fields are numbers. When an Equipotent record is selected all the tabs on the tab control are just all the fields that are part of the equipment table. Where my issue is that when I select a record the...
2
3610
by: jay | last post by:
Hi. I have created an unbound combo box in a form whose purpose is to pass parameters to a query and then requery the requery. The unbound combo box is named "ClosedFilter" The two parameters it will pass to the query called "qry_WkReq" is "Yes" and "No." (The field being requeried is a Yes/No type field.) After this, I created an event procedure after update and coded:
14
11471
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.
3
3341
by: mcmahonb | last post by:
Hey people... I've been searching this forum for a few hours and even though this topic has been went over from many different angles; I cannot seem to figure out how to make things work on my side. I am trying to learn how to manipulate Dynamic Queries by forms via the example database: QrySampl.MDB, offered by Microsoft (as a learning tool, I suppose.) In particular, I am working with code from the example: "Query By Form (QBF) Using...
8
4107
by: Michael R | last post by:
Dear users and experts, An unbound combo box in my form is responsible for changing a city name for an update query that creates a temprorary table which the form uses as its record source. In case that table is already created, and the combo box value is to be changed again, the temp. table needs to be deleted and the form needs to be requeried. I use on before update event of the combo box: Private Sub citylist_BeforeUpdate(Cancel As...
10
3505
by: themightypea | last post by:
Hi, I'm attempting to create a continuos form which allow the user to edit various fields for each item. Unfortunately, the data I need is spread over multiple tables so binding the control to the item in the underlying query prevents me from editing it. To get round this I've bound the controls to functions returning the data from an array, similar to the method described in http://www.thescripts.com/forum/thread193301.html. When the user...
2
1197
by: jamesnkk | last post by:
I have an Invoice form that consist of main form and a sub form. Main form consist of customer address and contact...etc Sub form is a continue form for item purchase. I have an unbound field - txtfreight, every time I enter an amount into the txtfreight, this Problem drive me nut - In the Afterupdate event on line 1 and line 2, I am trying to update the unbound txtfreight onto the field "freight", (1) but it never write or update to...
7
9308
AccessIdiot
by: AccessIdiot | last post by:
This is driving me nuts. I have an unbound textbox (txt_SumSize) in my subform that holds the total of a field (Debitage_Size_Quantity)seen in datasheet view (control source =Sum(). I have an unbound textbox on my form (txt_SizeTotal) that gets the value from the subform footer when the form loads: Private Sub Form_Load() Me.txt_SizeTotal = Me!sbfrm_DEBITAGE_Size.Form! End Sub
0
9632
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10302
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
10136
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
10071
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
9925
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
6723
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
5372
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...
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
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.