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

Home Posts Topics Members FAQ

A2K3 SubForm: Refresh, Requery? Arrrgh!

Here's the situation. A form, frmSetUp, with a subform control called
subExplain with a source object form frmSetUpSubDefineSides. The source
object is a bound form, displaying a few records, no edit, adds,
filters, etc, are permitted on the subform.

An add or edit button on the subform is clicked opening an unbound form,
frmSetUpSideAdd, (populated with values from the above subform if this
is an edit of an existing record) for data entry. The command in both
cases is DoCmd.OpenForm "frmSetUpSideAdd", acNormal, , , , acDialog

Data is added/changed on this dialog mode form and then an OK button
creates an insert or update statement, and I run the execute method in
ADODB. Works just fine.

However, the subform on frmSetUp does not refresh until I physically
click on the subform or prress F9: I've tried the following and several
setfocus type fiddling around:

docmd.close 'for the acDialog add/edit form, frmSetUpSideAdd

Forms!frmSetup.subExplain.Requery

Forms!frmSetup.subExplain.SetFocus

Forms!frmSetup.subExplain.Form.Refresh

I've also tried tossing in SendKeys "{F9}" and a Recalc and neither
work. I've also tried respecifying the source object, ie:

Forms!frmsetup.subExplain.SourceObject = "frmSetUpSubDefineSides"

But that won't work either.

Please help. A2K3 on Win XP SP1

--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #1
6 5464

"Tim Marshall" <TI****@antarctic.flowerpots> wrote in message
news:cj**********@coranto.ucs.mun.ca...
Here's the situation. A form, frmSetUp, with a subform control called
subExplain with a source object form frmSetUpSubDefineSides. The source
object is a bound form, displaying a few records, no edit, adds,
filters, etc, are permitted on the subform.

An add or edit button on the subform is clicked opening an unbound form,
frmSetUpSideAdd, (populated with values from the above subform if this
is an edit of an existing record) for data entry. The command in both
cases is DoCmd.OpenForm "frmSetUpSideAdd", acNormal, , , , acDialog

Data is added/changed on this dialog mode form and then an OK button
creates an insert or update statement, and I run the execute method in
ADODB. Works just fine.

However, the subform on frmSetUp does not refresh until I physically
click on the subform or prress F9: I've tried the following and several
setfocus type fiddling around:

docmd.close 'for the acDialog add/edit form, frmSetUpSideAdd

Forms!frmSetup.subExplain.Requery

Forms!frmSetup.subExplain.SetFocus

Forms!frmSetup.subExplain.Form.Refresh

I've also tried tossing in SendKeys "{F9}" and a Recalc and neither
work. I've also tried respecifying the source object, ie:

Forms!frmsetup.subExplain.SourceObject = "frmSetUpSubDefineSides"

But that won't work either.

Please help. A2K3 on Win XP SP1

--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto


Looks like one option you haven't tried is:

Forms!frmSetup.subExplain.Form.Requery

Nov 13 '05 #2
Eric Schittlipz wrote:
Looks like one option you haven't tried is:

Forms!frmSetup.subExplain.Form.Requery


Thanks, Eric, but that by itself, doesn't work either. 8(

I'm really hoping I've hit on some kind of Win XP themes bug - either
that or I've messed things up beyond belief! 8)

Thanks again - any other ideas?
--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #3

"Tim Marshall" <TI****@antarctic.flowerpots> wrote in message
news:cj**********@coranto.ucs.mun.ca...
Eric Schittlipz wrote:
Looks like one option you haven't tried is:

Forms!frmSetup.subExplain.Form.Requery


Thanks, Eric, but that by itself, doesn't work either. 8(

I'm really hoping I've hit on some kind of Win XP themes bug - either
that or I've messed things up beyond belief! 8)

Thanks again - any other ideas?
--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto


Just in case you are confusing the name of the subform control and the name
of the form itself, can you verify this:
Open the main form, then press Ctrl+G and type the following into the
immediate window and hit return.
?Forms!frmSetup.subExplain.Form.Name
This should return "frmSetUpSubDefineSides", and if it does, I can't see why
Forms!frmSetup.subExplain.Form.Requery fails to requery the form.
Considering that you are opening forms using acDialog, you may find the line
of code is not even run - at least not when you expect it to. Perhaps you
could step through the code to be sure this is running but 'does not work'.

As a general comment, I would add that in these sorts of situations, I get
the popup form to be bound. The code finds the ID of the main record and
the currently selected related record (or if creates a new record and gets
this ID). These two numbers are passed to the popup form as comma-separated
OpenArgs. Now I am able to have my popup form show all related records and
automatically go the selected (or new) record by using
RecordsetClone.FindFirst method. The code in the main form would then be:

DoCmd.OpenForm "frmSetUpSideAdd", acNormal, , , , acDialog
Me.subExplain.Form.Requery

This might be something you could consider.
Nov 13 '05 #4
Eric Schittlipz wrote:
can you verify this:
Open the main form, then press Ctrl+G and type the following into the
immediate window and hit return.
?Forms!frmSetup.subExplain.Form.Name
This should return "frmSetUpSubDefineSides",
Yes, this works as one would expect... 8(
Forms!frmSetup.subExplain.Form.Requery fails to requery the form.
Considering that you are opening forms using acDialog, you may find the line
of code is not even run - at least not when you expect it to. Perhaps you
could step through the code to be sure this is running but 'does not work'.


What's interesting is that when I step through the code and then turn
off the watches, the sub form behaves as expected/designed with
Forms!frmSetup.subExplain.Form.Requery. Then when the application is
turned on again, I have the same problem with requery - it does not work.

I'm not sure if your use of a bound popup would work in my case? I have
table constraints which won't let me just create a record and then open
the pop up. I could be misinterpreting what you're saying though.

But I don't understand why this is a problem - I did this many times in
A97 without a problem except with respect to forms where the
recordsource was an Oracle passthrough query and even then, the changing
of the subform's sourceobject took care of things.

This is extremely depressing - A2K3 should come with a complimentary
bottle of happy pills...

Another thought - are there any service packs for A2K3? My help just
says Access 2003 (11.5614.5606).
--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #5

"Tim Marshall" <TI****@antarctic.flowerpots> wrote in message
news:cj**********@coranto.ucs.mun.ca...
Eric Schittlipz wrote:
can you verify this:
Open the main form, then press Ctrl+G and type the following into the
immediate window and hit return.
?Forms!frmSetup.subExplain.Form.Name
This should return "frmSetUpSubDefineSides",
Yes, this works as one would expect... 8(
Forms!frmSetup.subExplain.Form.Requery fails to requery the form.
Considering that you are opening forms using acDialog, you may find the line of code is not even run - at least not when you expect it to. Perhaps you could step through the code to be sure this is running but 'does not

work'.
What's interesting is that when I step through the code and then turn
off the watches, the sub form behaves as expected/designed with
Forms!frmSetup.subExplain.Form.Requery. Then when the application is
turned on again, I have the same problem with requery - it does not work.

I'm not sure if your use of a bound popup would work in my case? I have
table constraints which won't let me just create a record and then open
the pop up. I could be misinterpreting what you're saying though.

But I don't understand why this is a problem - I did this many times in
A97 without a problem except with respect to forms where the
recordsource was an Oracle passthrough query and even then, the changing
of the subform's sourceobject took care of things.

This is extremely depressing - A2K3 should come with a complimentary
bottle of happy pills...

Another thought - are there any service packs for A2K3? My help just
says Access 2003 (11.5614.5606).
--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto


Perhaps I have seen something like that before... I have dim memories of
getting around an issue like this by re-specifying the subform's
recordsource property which forced it to requery. I saw from your earlier
post that you had re-specified the SourceObject, but you didn't say you'd
tried this one:

Forms!frmSetup.subExplain.Form..RecordSource = "qryMyQuery"

Worth a last try?


Nov 13 '05 #6
Eric Schittlipz wrote:
Forms!frmSetup.subExplain.Form..RecordSource = "qryMyQuery"

Worth a last try?


I was excited about this one, but alas, no. Also I installed the 2003
SP1 to no avail either. 8(

I really appreciate the trouble you've gone through to help me out, and
everything you've suggested _should_ have worked AFAIK. I've just
broken down and called MS with my credit card to see if they can help.

If we can get it working I'll post a synopsis again and how it was fixed.

--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #7

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

Similar topics

1
4227
by: Rob | last post by:
Hi, I have a application in Access 2000.The subform has a few combo boxes.These are for groups,divison ,names and department respectively and each combo box is dependent on the value selected of...
0
1362
by: Norman Fritag | last post by:
Hi there, I have one subform in a Master form, which is set to add mode only. I allow only for data entry. Sofar all words fine. All information on the main form is set for display only and have...
0
1908
by: Dalan | last post by:
I'm sure there is a workaround for this, but haven't found it yet. I have a mainform with two subforms and after one or both of the subforms are updated, then clicking the Refresh button on the...
4
6967
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...
4
13099
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays...
1
5413
by: Stinky Pete | last post by:
Hi everyone, I have been updating a file that uses a main form that contains a subform (as a datasheet). The main form really does not do anything on opening except maximizes to the users...
6
5320
by: AppDev63 | last post by:
I've been struggling with a form. On the left side of the form I've got data from a table of invoices, and on the right side I've got a combo box with data from a table of payments. The user scrolls...
28
5452
by: Rotorian | last post by:
Hello again, I have a subform that gets populated from a records query. I needed the subform to refresh once a record is added via another form. I accomplished this by re-running the query for...
3
20580
Jerry Maiapu
by: Jerry Maiapu | last post by:
Hi all, I have a child and parent forms. The record source of the sub-form is query containing aggregate functions. A combo box in the parent form filters the sub-form results based on value...
0
7205
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
7093
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
7287
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
7349
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...
1
7008
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...
0
5594
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
4688
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...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
399
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...

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.