473,394 Members | 1,946 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,394 software developers and data experts.

SubForm on Tab Control Issue

Access XP
Access 2002 format.
I have a subform on a tab control. The subform has the following
code (error trapping removed to make post shorter)... When I close the
parent form it goes 100% as designed UNLESS I have used one of the sort
buttons to sort the sub form on any given field. If I do sort, there is
a delay fo about 5 seconds until after the parent form closes and the
previous form re-opens. It appears that there may be some sort of save
going on. I don't want the sub form saved. I want it to simply close
along with the parent form and return to the previous form.

First, do you follow waht I just attempted to describe (I am not
all that good at describing situations sometimes)? Second, is there a
way to eliminate this delay?

Thanks,
DB
----- CODE -----

Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open

Me.OrderByOn = True

End Sub
'Sorts on the Requested Field.
Private Sub bSortAscending_Click()

Screen.PreviousControl.SetFocus
Me.OrderBy = Screen.ActiveControl.ControlSource

End Sub
'Sorts on the Requested Field Descending.
Private Sub bSortDescending_Click()

Screen.PreviousControl.SetFocus
Me.OrderBy = Screen.ActiveControl.ControlSource & " DESC"

End Sub

----- CODE -----
Nov 12 '05 #1
2 2053
Well, one approach would be "don't use the sort buttons...". I think you'll
find they alter the Filter property, and it may well be saved. Perhaps you
might consider setting the Filter property of the Form embedded in the
Subform Control to "" in the Close event of the main form -- I'm not sure
that will prevent the save, but it will prevent the Filter from being
automatically applied the next time you use the form/subform.

As an alternative to using the sort buttons, you could add your own button
to recreate the RecordSource with a different GROUP BY. Overall, that may be
no more efficient, but it might eliminate the delay at closing.

Larry Linson
Microsoft Access MVP

"Ima Lostsoul" <me@myprovider.com> wrote in message
news:MP************************@netnews.comcast.ne t...
Access XP
Access 2002 format.
I have a subform on a tab control. The subform has the following
code (error trapping removed to make post shorter)... When I close the
parent form it goes 100% as designed UNLESS I have used one of the sort
buttons to sort the sub form on any given field. If I do sort, there is
a delay fo about 5 seconds until after the parent form closes and the
previous form re-opens. It appears that there may be some sort of save
going on. I don't want the sub form saved. I want it to simply close
along with the parent form and return to the previous form.

First, do you follow waht I just attempted to describe (I am not
all that good at describing situations sometimes)? Second, is there a
way to eliminate this delay?

Thanks,
DB
----- CODE -----

Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open

Me.OrderByOn = True

End Sub
'Sorts on the Requested Field.
Private Sub bSortAscending_Click()

Screen.PreviousControl.SetFocus
Me.OrderBy = Screen.ActiveControl.ControlSource

End Sub
'Sorts on the Requested Field Descending.
Private Sub bSortDescending_Click()

Screen.PreviousControl.SetFocus
Me.OrderBy = Screen.ActiveControl.ControlSource & " DESC"

End Sub

----- CODE -----

Nov 12 '05 #2
Thanks Larry... The sub form has numerous fields that the client wants
to be able to sort on. I THINK I may have found a fix. I'll post an
FYI when I get the project done. This is a electronic audit workpaper
system that I am writing. Them audit types like sorting and poking at
data ya know! They are paying me well so I'll code whatever the heck
thay want. :)

:)

In article <dG*****************@nwrddc01.gnilink.net>,
bo*****@localhost.not says...
Well, one approach would be "don't use the sort buttons...". I think you'll
find they alter the Filter property, and it may well be saved. Perhaps you
might consider setting the Filter property of the Form embedded in the
Subform Control to "" in the Close event of the main form -- I'm not sure
that will prevent the save, but it will prevent the Filter from being
automatically applied the next time you use the form/subform.

As an alternative to using the sort buttons, you could add your own button
to recreate the RecordSource with a different GROUP BY. Overall, that may be
no more efficient, but it might eliminate the delay at closing.

Larry Linson
Microsoft Access MVP

"Ima Lostsoul" <me@myprovider.com> wrote in message
news:MP************************@netnews.comcast.ne t...
Access XP
Access 2002 format.
I have a subform on a tab control. The subform has the following
code (error trapping removed to make post shorter)... When I close the
parent form it goes 100% as designed UNLESS I have used one of the sort
buttons to sort the sub form on any given field. If I do sort, there is
a delay fo about 5 seconds until after the parent form closes and the
previous form re-opens. It appears that there may be some sort of save
going on. I don't want the sub form saved. I want it to simply close
along with the parent form and return to the previous form.

First, do you follow waht I just attempted to describe (I am not
all that good at describing situations sometimes)? Second, is there a
way to eliminate this delay?

Thanks,
DB
----- CODE -----

Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open

Me.OrderByOn = True

End Sub
'Sorts on the Requested Field.
Private Sub bSortAscending_Click()

Nov 12 '05 #3

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

Similar topics

3
by: Charlene | last post by:
I have an Invoice/Invoice Details form/subform. In the page footer of the Invoice Details subform I have a textbox with the control source set to =Sum(). I then pull this value into the main form...
2
by: John Baker | last post by:
Hi: I have a sub form which i would like to show all the records selected from a table. There may well be over 100 of them. For reasons I cant fathom, the form will only show six, and then...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
1
by: phaddock4 | last post by:
Being fairly inexperienced at Access 2000, i've been reading many posts here for the last several days, and testing myself to find the best approach to do the following in A2K: SET UP: I have...
1
by: Terrell Miller | last post by:
Help, I'm getting strange results on a subform and I'm wondering if anybody knows what is causing it... I have a form linked to TableA. On that form is a tab control. Page1 is just the controls...
6
by: dhowell | last post by:
I have a "form" and "subform" where I would like a calculated control on the form which sums the values of a datasheet column of the subform. (datasheet on subform may have a variable number of...
4
by: crystal | last post by:
I've checked the threads but haven't been able to come up with a solution to my issue. Help...... I have a simple form based on a table. Within the form is a subform that is also, through a Q,...
3
by: Kitana907 | last post by:
Hi- I am having issues with adding up fields in a subform. I have a form that has a subform in datasheet mode. It lists titles of books with their correlating units and dollar amount . The...
7
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
1
by: David_from_Chicago | last post by:
I am developing an application in Access 2000 (A2K) which has multiple forms and subforms. Until now, all subforms displayed scroll bars properly (according to the subform's property setting). ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.