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

Home Posts Topics Members FAQ

Subform refresh or requery??

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 screen size. The subform
however runs an "embedded" query (cause I don't know the right term)
to show a list of records based on the embedded query. BTW, by
embedded, I'm indicating the form does not run an external query but
uses the query included as part of the forms design.

Anyway, for some reason the subforms query occasionally generates an
error message telling me that the data cannot be found when the file
is opened. When clicking OK, the main form/subform comes up but the
subform section is a blank white screen. However, when I open two
forms that use the same data source the subforms query uses, both
forms work fine and I can then open the main form/subform again and
work away merrily.
>From reading this newsgroup, it appears that the use of either requery
or refresh may help when the file opens. What i really would like to
understand better is which one is the better option to ensure the
query runs after the main form loads. From digging, it appears the
subform may try to load before the main form does. My reading of this
group seems to be indicating I need to have a separate query in order
to get either option to run. Do I simply need an stand alone query to
run? Do I even need either option? Am I looking at the wrong option?

Any help would be appreciated.

Regards,

Stinky Pete

Feb 5 '07 #1
1 5414
On Feb 5, 5:43 am, "Stinky Pete" <Peter.Mor...@s ymbionhealth.co m>
wrote:
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 screen size. The subform
however runs an "embedded" query (cause I don't know the right term)
to show a list of records based on the embedded query. BTW, by
embedded, I'm indicating the form does not run an external query but
uses the query included as part of the forms design.

Anyway, for some reason the subforms query occasionally generates an
error message telling me that the data cannot be found when the file
is opened. When clicking OK, the main form/subform comes up but the
subform section is a blank white screen. However, when I open two
forms that use the same data source the subforms query uses, both
forms work fine and I can then open the main form/subform again and
work away merrily.
From reading this newsgroup, it appears that the use of either requery

or refresh may help when the file opens. What i really would like to
understand better is which one is the better option to ensure the
query runs after the main form loads. From digging, it appears the
subform may try to load before the main form does. My reading of this
group seems to be indicating I need to have a separate query in order
to get either option to run. Do I simply need an stand alone query to
run? Do I even need either option? Am I looking at the wrong option?

Any help would be appreciated.

Regards,

Stinky Pete
My first thought is that your subform's query is referencing a value
in one of the forms in a "WHERE" clause of some sort.

My second thought is that you can always apply a query later with the
Filter and FilterOn method.

My third thought is that, usually, a subform and a form are related in
the properties of the subform, and that they try to link data in the
subform to data in the form. If you have a link there, but no data on
the main form, possibly that's the source of your issue.

Pasting your query's SQL code might be a start to getting a real
answer.

Jon

Feb 5 '07 #2

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

Similar topics

0
1911
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 mainform (to show updated values), causes the updated subform(s) to automatically scroll up to one blank line if a new record was entered, or to the...
2
1926
by: Debster | last post by:
I am having a hard time trying to figure out why my code is not working properly. I step through the code and check the values when adding the data to the table, but my Refresh or Requery is not displaying on the subform. Any suggestions? Thanks for your help!!!!!!!!!! ********************** Code ************************************* ...
6
5468
by: Tim Marshall | last post by:
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,...
3
1922
by: panwala_bhavesh | last post by:
I have a subform in continuous form style that I use to populate 3 fields (textboxes) on my main form with a double-click of the key-field textbox of the sub: Private Sub TextBattID_DblClick(Cancel As Integer) Forms!. = Me! Forms!. = Me! Forms!. = Me! End Sub
1
9445
by: Parasyke | last post by:
I have a subform within a tabpage that will requery/refresh (?) if I press F9 and it will update the data in the subform, but I have tried various combinations of Me!SubformName.requery Me!Forms!Subformname.requery, etc. to put the F9 functionality into VBA code but nothing seems to work... any ideas? Thanks!
7
4078
by: SBC News Groups | last post by:
I have a form that the user enters some information on and then clicks a button to save the record. I do with the following line: DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Once this line executes, I have a sub form that I want to "refresh" because the newly saved information should now display on the sub form....
6
7980
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...
3
3449
by: LROCCO | last post by:
Hi, I have a form which contains a subform. When I'm entering data into the subform it seems to requery automatically. When this occurs the focus goes to the start of the subform. Firstly, do subforms requery automatically? ....and if so can this be stopped?
1
19639
by: Simon van Beek | last post by:
Dear reader, After same changes it is required to requery (refresh) query in a sub form. The code below is not working:
0
7512
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...
0
7438
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...
0
7707
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. ...
0
7951
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...
1
7466
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...
0
7803
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...
0
5082
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...
0
3495
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...
1
1926
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

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.