473,287 Members | 1,643 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

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 5448

"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
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
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
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
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
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
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
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
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
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
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.