473,465 Members | 1,524 Online
Bytes | Software Development & Data Engineering Community
Create 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 1945
Chris Belcher <ch******@bellsouth.net> wrote in message news:<9r****************@bignews1.bellsouth.net>.. .
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.RequerySubform2(CStr(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.Visible = False Then
Subform2.Visible = True
Exit Sub
End If
Subform2.Form.RecordSource = "SELECT * FROM tblIDOItems WHERE IdIDO =
" & strIdIDO & " ORDER BY IdItem;"
Subform2.Form.Refresh
Subform2.Form.Repaint 'this line may not be needed
If Subform1.Form.MaterialProcessed = True Then
Subform2.Form!Process.Locked = True
Else
Subform2.Form!Process.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
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...
0
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...
2
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...
14
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....
3
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...
8
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...
10
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...
2
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 -...
7
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...
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
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
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...
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
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...
0
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...
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...

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.