472,808 Members | 3,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Problems using unbound controls as criteria, and other Acc'03 oddities

I'm developing an application for use within my company in Access 2003.
I'm new to '03, the application I did for my former employer was in
'97. The two applications have similar functionality (we're sales
offices, and I'm doing things such as associate directories, commission
calculations, order tracking, etc.). 2003 seems to have a few extra
features, but I seem to continually run in to oddities that seem like
they SHOULD work, but don't, or are just plain flaky. I can't figure
out if there's something I'm doing wrong, or if 2003 is just plain
flakier. I have a form I'm working on now that has two examples:

This form is for sales commissions: people in accounting will use it
to enter data, and the sales people will use it to view their own data.
Our commissions come in different forms, and need to be calculated
differently depending on the type of sale. Therefore, the main form
has several subforms, each of which handles a particular "type" of
commission data, and may have further subforms within it. One of the
things I do quite commonly, and am also doing here, is use unbound
controls on the main form that are used as filters for the data that is
displayed. In this case, the main form has a combobox with all of the
sales people in it, a couple of other controls to enter a date range of
data that they may want to review. Queries that make up the record
source of the individual subforms include these as criteria to
determine which records to display. I'm am starting to get issues
where when the form is closed, a parameter query type pop-up is asking
for the data that comes from the unbound "filter" controls. It's as if
the main form is closing first, and the queries in the sub-forms is
freaking out because data that it needs is now gone. I'm confused by
this for two reasons: a), the subforms aren't being re-queried, so I
don't know why they are looking for that data anyway, and b), why are
they apparently closing after the main form? I've NEVER had this
problem in '97. And I don't always have it in 2003. It seems almost
random, but once I create a subform that causes the problem, it happens
every time that form is closed. It's benign... the user can either hit
OK or Cancel to make it go away, since the form is closing anyway. But
it's quite bothersome, and makes the project look shoddy. In the
current case, it started happening after adding a subform that from a
data perspective is almost an exact copy of the one of the existing
subforms that didn't cause the problem, except it has some fields
removed, and another one added, to sum the data by salesperson.

The other problem I'm having is, one of the subforms is a continuous
form, with two "total" fields in the footer, which are simply sums of
data in the detail section. These two fields display a jittering
"Error", as if it's in some loop trying to calculate the values. When
the form is first opened it defaults to showing all the records, and
this particular subform shows commission splits for the current record
of it's parent which shows sales transactions. The ONLY thing that is
required to get them to calculate correctly is to re-query the subform
with the jittering fields. ALL of the data that the problematic Sum()
fields are supposed to be summing is filled in, but they can't seem to
sum it until you re-query it. What's worse, I can't seem to find a
place to simply put the re-query command in that will automatically
take care of it... I've tried putting it in the main form's and
subform's load, open, and activate events, but it doesn't seem to work
unless I attach the re-query command to a command button that the user
clicks. Again, something that makes it look shoddy.

Admittedly, the queries and multiple subforms make it a little complex,
but I've certainly done the exact same thing with even more complex
queries and form/subform levels in '97, and never had these problems.
I know this is kind of vague, but does anyone have any clues or
suggestions?

Mar 20 '06 #1
3 2671
Your two problems may be related. When you do a Requery command and the
parameter criteria values are not available (your comboboxes are empty) then
you'll get the parameter popups. Search your form's module for all
instances of "Requery".

Totaling of value(s) on subforms can be done by using an unbound control on
the main form and using a Domain function (DSum, etc.) as the control source
to calculate the desired amounts. You'd need to requery that unbound
control on main form Open and on AfterUpdate of the underlying subform
controls.
-Ed

<go****@darincline.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
I'm developing an application for use within my company in Access 2003.
I'm new to '03, the application I did for my former employer was in
'97. The two applications have similar functionality (we're sales
offices, and I'm doing things such as associate directories, commission
calculations, order tracking, etc.). 2003 seems to have a few extra
features, but I seem to continually run in to oddities that seem like
they SHOULD work, but don't, or are just plain flaky. I can't figure
out if there's something I'm doing wrong, or if 2003 is just plain
flakier. I have a form I'm working on now that has two examples:

This form is for sales commissions: people in accounting will use it
to enter data, and the sales people will use it to view their own data.
Our commissions come in different forms, and need to be calculated
differently depending on the type of sale. Therefore, the main form
has several subforms, each of which handles a particular "type" of
commission data, and may have further subforms within it. One of the
things I do quite commonly, and am also doing here, is use unbound
controls on the main form that are used as filters for the data that is
displayed. In this case, the main form has a combobox with all of the
sales people in it, a couple of other controls to enter a date range of
data that they may want to review. Queries that make up the record
source of the individual subforms include these as criteria to
determine which records to display. I'm am starting to get issues
where when the form is closed, a parameter query type pop-up is asking
for the data that comes from the unbound "filter" controls. It's as if
the main form is closing first, and the queries in the sub-forms is
freaking out because data that it needs is now gone. I'm confused by
this for two reasons: a), the subforms aren't being re-queried, so I
don't know why they are looking for that data anyway, and b), why are
they apparently closing after the main form? I've NEVER had this
problem in '97. And I don't always have it in 2003. It seems almost
random, but once I create a subform that causes the problem, it happens
every time that form is closed. It's benign... the user can either hit
OK or Cancel to make it go away, since the form is closing anyway. But
it's quite bothersome, and makes the project look shoddy. In the
current case, it started happening after adding a subform that from a
data perspective is almost an exact copy of the one of the existing
subforms that didn't cause the problem, except it has some fields
removed, and another one added, to sum the data by salesperson.

The other problem I'm having is, one of the subforms is a continuous
form, with two "total" fields in the footer, which are simply sums of
data in the detail section. These two fields display a jittering
"Error", as if it's in some loop trying to calculate the values. When
the form is first opened it defaults to showing all the records, and
this particular subform shows commission splits for the current record
of it's parent which shows sales transactions. The ONLY thing that is
required to get them to calculate correctly is to re-query the subform
with the jittering fields. ALL of the data that the problematic Sum()
fields are supposed to be summing is filled in, but they can't seem to
sum it until you re-query it. What's worse, I can't seem to find a
place to simply put the re-query command in that will automatically
take care of it... I've tried putting it in the main form's and
subform's load, open, and activate events, but it doesn't seem to work
unless I attach the re-query command to a command button that the user
clicks. Again, something that makes it look shoddy.

Admittedly, the queries and multiple subforms make it a little complex,
but I've certainly done the exact same thing with even more complex
queries and form/subform levels in '97, and never had these problems.
I know this is kind of vague, but does anyone have any clues or
suggestions?

Mar 20 '06 #2
Thanks for the reply! Actually, the first problem has now gone away.
I added a sort order to the recordset of this subform, and suddenly the
sum fields are calculating fine from the beginning. There were a
couple of other times while I was working on this form that the sum
fields wouldn't have any problems, but then I'd make another change and
the problem would return. For what ever reason, adding a sort order to
the records seems to have permanently (hopefully) solved the problem
with the totals. Of course, I'm still mystified... I don't know why
the ORDER of the records would affect their sum, or the ability to
calculate one. But I guess for now I'll just be happy that the issue
has gone away.

On the second issue, I have searched through my code to find instances
of requery... I do have it in several places - places that I need it
(like the after update event of the unbound controls that I'm using for
filter criteria so the data updates when the user changes the filter
criteria, just like I do in many other forms with similar
functionality), but I don't have it in any events that should be
triggering when the form closes.

Mar 20 '06 #3
test

<go****@darincline.com>
??????:11**********************@e56g2000cwe.google groups.com...
I'm developing an application for use within my company in Access 2003.
I'm new to '03, the application I did for my former employer was in
'97. The two applications have similar functionality (we're sales
offices, and I'm doing things such as associate directories, commission
calculations, order tracking, etc.). 2003 seems to have a few extra
features, but I seem to continually run in to oddities that seem like
they SHOULD work, but don't, or are just plain flaky. I can't figure
out if there's something I'm doing wrong, or if 2003 is just plain
flakier. I have a form I'm working on now that has two examples:

This form is for sales commissions: people in accounting will use it
to enter data, and the sales people will use it to view their own data.
Our commissions come in different forms, and need to be calculated
differently depending on the type of sale. Therefore, the main form
has several subforms, each of which handles a particular "type" of
commission data, and may have further subforms within it. One of the
things I do quite commonly, and am also doing here, is use unbound
controls on the main form that are used as filters for the data that is
displayed. In this case, the main form has a combobox with all of the
sales people in it, a couple of other controls to enter a date range of
data that they may want to review. Queries that make up the record
source of the individual subforms include these as criteria to
determine which records to display. I'm am starting to get issues
where when the form is closed, a parameter query type pop-up is asking
for the data that comes from the unbound "filter" controls. It's as if
the main form is closing first, and the queries in the sub-forms is
freaking out because data that it needs is now gone. I'm confused by
this for two reasons: a), the subforms aren't being re-queried, so I
don't know why they are looking for that data anyway, and b), why are
they apparently closing after the main form? I've NEVER had this
problem in '97. And I don't always have it in 2003. It seems almost
random, but once I create a subform that causes the problem, it happens
every time that form is closed. It's benign... the user can either hit
OK or Cancel to make it go away, since the form is closing anyway. But
it's quite bothersome, and makes the project look shoddy. In the
current case, it started happening after adding a subform that from a
data perspective is almost an exact copy of the one of the existing
subforms that didn't cause the problem, except it has some fields
removed, and another one added, to sum the data by salesperson.

The other problem I'm having is, one of the subforms is a continuous
form, with two "total" fields in the footer, which are simply sums of
data in the detail section. These two fields display a jittering
"Error", as if it's in some loop trying to calculate the values. When
the form is first opened it defaults to showing all the records, and
this particular subform shows commission splits for the current record
of it's parent which shows sales transactions. The ONLY thing that is
required to get them to calculate correctly is to re-query the subform
with the jittering fields. ALL of the data that the problematic Sum()
fields are supposed to be summing is filled in, but they can't seem to
sum it until you re-query it. What's worse, I can't seem to find a
place to simply put the re-query command in that will automatically
take care of it... I've tried putting it in the main form's and
subform's load, open, and activate events, but it doesn't seem to work
unless I attach the re-query command to a command button that the user
clicks. Again, something that makes it look shoddy.

Admittedly, the queries and multiple subforms make it a little complex,
but I've certainly done the exact same thing with even more complex
queries and form/subform levels in '97, and never had these problems.
I know this is kind of vague, but does anyone have any clues or
suggestions?

Mar 21 '06 #4

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

Similar topics

0
by: Andrew Kunz | last post by:
Anyone else have any trouble with the 1.1 upgrade? we get dialog boxes prompting to insert media into \dev\hardisk0\dr1 or similar, usually cause by vb.net code checking the process table although...
5
by: jose luis fernandez diaz | last post by:
Hi, When I compiling the program below: #include <map> using namespace std; template<typename td1, typename td2, typename td3,typename td4> class Tarificador
7
by: Malcolm Cook | last post by:
Hi, I've created and installed a custom UDF to populate my combobox, and have defined it per :...
9
by: Colin McGuire | last post by:
Hi, I have an report in Microsoft Access and it displays everything in the table. One column called "DECISION" in the table has either 1,2, or 3 in it. On my report it displays 1, 2, or 3. I want...
2
by: Paul Wagstaff | last post by:
Hi all Our organisation is moving form Win NT / full version of Acc 97 to Win XP / run-time version of Acc 03 (as part of Office 03) for the users. We have heaps of mdbs on the servers - some...
3
by: Paul Wagstaff | last post by:
Hi All I have an aggregate query that groups by each user, then calculates Sum(TimeInvested). I need to display the total time (per user) in hrs / mins e.g. 45:30 (= 45 hrs 30 mins). Can...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.