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

How to make a totals field by combobox data

I have created a form from my table, the form contains a Payment Field and a Combo box that contains 3 methods of payment i.e. Cash,Credit Card, Cheque.
I have created a totals field to sum the total payments, now i want another field to display Total Payments by Cash from my combo list. this i think is simple but i just can't get my head around it.

Thanks
Jun 1 '10 #1
6 1706
@john c hill
hi
you can check for payment mode then ....you can use selected indexchanged event of combobox in that u can add or display cash amount using textbox.text=combobox_selectedValues.tostring();
Jun 1 '10 #2
Thank you for your reply but could you give me more detail as i dont really understand
Jun 1 '10 #3
if u have any code for that send me i will tell you what to add in that
thanks
Jun 2 '10 #4
MMcCarthy
14,534 Expert Mod 8TB
Hi John

To get back to your original question.

Assuming you are putting your total textboxes in the form footer and that total for the payments is
Expand|Select|Wrap|Line Numbers
  1. =sum([Payments])
then I think what you are looking for is to sum based on an IIf statement. Assuming your combo box is called cboPaymentType the following should work.
Expand|Select|Wrap|Line Numbers
  1. =Sum(IIf([cboPaymentType]='Cash',[Payment],0))
The logic of this being if the combo box is set to Cash then include the payment in the sum, otherwise include 0.
Jun 2 '10 #5
works just fine, fantastic thanks so much
John
Jun 7 '10 #6
MMcCarthy
14,534 Expert Mod 8TB
@john c hill
You are very welcome.

Mary
Jun 10 '10 #7

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

Similar topics

2
by: zion saal | last post by:
i wont to make a field in a select query to put two fields from a table into one field or control like " Expr1:&' '& " but the problem is thet "field1" is a Currency format and field2 is a...
0
by: Dmitry Karneyev | last post by:
Hi! I've got a binded combobox, currencymanager object and a SelectionChangeCommitted event handler. In event handler I retieve data from a binded field and fill other field using this...
3
by: viktop | last post by:
Hi! How to make a transparent ComboBox? Thank Victor
2
by: ksedran | last post by:
Hello, I have a combobox in a winform set up with the following code: da = New OracleDataAdapter("select curr_code || '=' || desc As curr_desc, curr_code from tablename", Conn) da.Fill(ds,...
4
by: pointies | last post by:
I have a form with a ComboBox with a list of users. The ComboBox is set on a Table/Query to look up the Employee Names by their ID. The ComboBox is named AssignedTo If I set up a Textbox with...
1
by: Pradeep83 | last post by:
Hi All Can anybody tell me like how to tell make a copy of data into RAM from hard disk for faster accessing of data?? My Postgres database and its contents(databases,tables are sitting in...
1
FSUKXAZ
by: FSUKXAZ | last post by:
I'm trying to change Identity on field w/Data using SQL Manager and cannot. The table is called Members and the field is called MemberID. It is already the Primary key, Not Null, and Unique...
3
by: Gaurav Jhamb | last post by:
I have 2-3 forms.On my first form when i serach to put any word it sends results and after that i click on new button in my search i got different organisation names. on the secong form i passed the...
4
by: Sammatter | last post by:
Hi I need some help on how to make a field in my database unique using VBA only. I am not allowed to make it into an AutoNumber and I have no clue. Would appreciate any help given ASAP, thanks.
2
by: Resmy Ravi | last post by:
how to make a field null in access
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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
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...

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.