473,473 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DMAx code not working

18 New Member
Hi,

I have a db that is giving me a problem. I have a form which contains a sub-form that displays data that is filtered from combo boxes and option buttons. This all works fine.

I now text boxes at the bottom of my main form which display certain data (count records in sub form, Average attendance, Average mark scored, and highest expense paid). These are all linked to text boxes in the footer of the sub form.

I have got working the count records and average attendance however the remaining two boxes are stumping me.

The problem I have encountered is the last box. I want to display the maximum cost of expenses displayed in the sub form. I have tried DMax as a start but I want to still view all the records in the subform however I need to display in the text box the value of the highest paid.

The current code in the text box is as follows:
Expand|Select|Wrap|Line Numbers
  1. =[front screen data subform].[Form]![Transport Expenses]
When applying the DMax to this it ceases to work. No error but the text box is left blank.

Any ideas??
Apr 1 '11 #1

✓ answered by NeoPa

My mistake. I used the term Sum() instead of Max(). The concept is the same. They are just two of many functions available in both Aggregate and Domain Aggregate types. The D of DMax() refers to Domain. I'm suggesting you need to use the simple Aggregate version instead.

7 2151
Rabbit
12,516 Recognized Expert Moderator MVP
You can't use DMax on a control. You use DMax on a table or query and you supply the field or expression you want to apply DMax to.
Apr 1 '11 #2
JackieSmith
18 New Member
any suggestions for an alternative then?? I need to meet the above criteria

Thanks
Apr 1 '11 #3
NeoPa
32,556 Recognized Expert Moderator MVP
Suggestions are difficult at this stage, with so little meaningful information from you. You say you are trying to use DMax(), but you give no examples of how or where. Perhaps if you put the question down fully we would be in a position to be of more help. These tips are all explained in the sticky posts you should have read prior to posting your first question.

I suspect you need to use the Sum() function somewhere, but where will be much easier to determine with the relevant information available.
Apr 2 '11 #4
JackieSmith
18 New Member
I used the DMax code as mentioned above within the text box. It was used in expression builder. I am not looking to any summation of the data.

My intent is for the text box to display the maximum value displayed within the sub form that is under the heading Travel expenses.
Apr 4 '11 #5
NeoPa
32,556 Recognized Expert Moderator MVP
My mistake. I used the term Sum() instead of Max(). The concept is the same. They are just two of many functions available in both Aggregate and Domain Aggregate types. The D of DMax() refers to Domain. I'm suggesting you need to use the simple Aggregate version instead.
Apr 4 '11 #6
JackieSmith
18 New Member
You were correct. When I altered to a simple Max code this worked correctly. Thanks for the help. Very appreciated!!
Apr 9 '11 #7
NeoPa
32,556 Recognized Expert Moderator MVP
No worries Jackie. Glad to be of help :-)
Apr 9 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Abubakar | last post by:
HI all, working in the vs.net 2k5 beta 2, I write the following code which gives me an exception: ContextMenu textboxmenu = textBox2.ContextMenu; MenuItem menuitem = new MenuItem("hello"); ...
14
by: menakasrinivasagam | last post by:
my coding is working in mozilla firefox.but not working in Internet explorer.plz give suggestion to rectify this problem
5
by: athirai | last post by:
Hi all, I want to scroll within a window. <a href="javascript:window.location('#first');">First</a> When i click First then it moves to the particular anchor tag within the same page. <a...
10
by: Mike | last post by:
I have code that is doing some updating to a record. Its getting the ID to update from the Grid. I'm passing an INT to my method to update the record. My code is working though I'm still getting an...
26
by: Jenitha S | last post by:
Hi, I am working in JSP code.A Menubar is displayed in JSP page.It's working fine in IE. But in case of firefox the very first menuitem is not working.If i move that menu item as second means it's...
1
by: suneel271 | last post by:
code working in internet explorer but not in mozilla and iam getting erroe like window.event has no properties and here is the code <%@ page language="java" contentType="text/html;...
3
by: kepskp | last post by:
i just write code for select option in combo box which i m select but when i press search button and then click on back button then there in no option selected. and that same code working in ie7 and...
2
by: Taftheman | last post by:
Hi, I have created a pop up using js and returns a value for me to process. I have got it working. I now need to do it again for another button. The value return will be processed differently. But as...
1
by: bogdanm | last post by:
Hello everyone, I am having a probleme with a issuu code when trying to insert it o my site it doesnt work in IE but in mozzila works fine the code is bellow: <div><object...
0
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
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,...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.