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

Help with expression in MS Access Subform

Thank you in advance for helping someone very new to Access and VBA.

I have a database that has been used in my department for years and strikes me as a little inefficient in terms of the details it provides. The data details ticket accounts and so far I have had to manually figure out how many tickets each account has left. I would like to employ a code that will automatically perform this function and display the balance in the table. The table fields read as follows:

Field1 = PaymentTicketsIssued (ComboBox--Payment or TicketsIssued)
Field2 = Type of Ticket (ComboBox--Adult or Child)
Field3 = Tickets Issued (Quantity of tickets issued)
Field4 = AdultPurchased (Quantity Purchased)
Field5 = ChildPurchased (Quantity Purchased)
Field6 = AdultRemaining (Quantity left)
Field7 = Child Remaining (Quantity left)

The code needs to:

Identify when and how many Adult and Child tickets are issued, respectively.
Subtract AdultPurchased/ChildPurchased from Adult/Child TicketsIssued respectively.
Display the corresponding balance in the AdultRemaining/ChildRemaining fields.

Thank you again for any assistance you can offer!
Sep 21 '10 #1
1 1288
jimatqsi
1,271 Expert 1GB
It's not very clear what you want. Do you want to add some columns to the database table? Or are you describing a form you would like to have?

I think what you really want is to make a query with the query wizard, then you can run the query and see virtual columns showing the computed values.

You say " The table fields read as follows" but it looks like you are telling about form objects, not the table definition. Combo boxes are form objects, not part of a table definition.

What is the name of the table(s) this stuff is in and what are the elements? I don't see an account number/identifier listed, but I think you will want to group by that.

Also, you say "identify when", but there is no date/time data item. What do you mean by that?

Try making a new query based on the table with your ticket information. Start off by using the new query wizard - it can automatically group for you and compute sums, averages and some other nifty things. When that is done, take a look at the query in design mode to see how the query works. You'll learn a lot from that. Just double-click on the query name to see the resulting data.

Then come back with more details and questions :)

Jim
Sep 22 '10 #2

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

Similar topics

2
by: Alienz | last post by:
Lets say I have a form called Planet_Systems and a form called Species. I then want to link the primary key "Planet" to bring up it's various species in the corresponding subform. So, I created a...
1
by: kevin | last post by:
I have created a main form with a combo box (cbo_student_events) that has a drop down list for various student events. I have a subform that displays all the corresponding data for the...
1
by: mkhalid | last post by:
Hi... I am doing an assignment of MS access. I have made 3 tables (One joining table for M:M relationship). When I was trying to make a form (a form with subform) to update the fields, an error...
4
by: Don Do | last post by:
Help I built a form/subform/subsubform setup using the access forms wizard. I have a table1 = parent, table2 = child, table3 = (grandchild?). There will be multiple records in table2 that tie...
4
by: jhockey | last post by:
Hi, I am new to Access. Can someone please help me. Access 2000 I have a form that works. I want to add a subform based on the selection of a drop down list. Drop down list contains A B ...
1
by: sprasad123 | last post by:
Need bit of a help with Access to SQL subform queries i have upsized a Access DB. It also has a Access frontend. The upsized went ok. I relinked the Access linked table to SQL. When I try to add a...
1
by: hemant kamble | last post by:
Hi all, I am hemant , I am new for VB. Can sombody help to access serial port in VB on windows XP. I am trying with Ports.bas but ididn't get success kindly anybody give code for access serial...
0
by: hemant kamble | last post by:
Hi all, I am hemant , I am new for VB. Can sombody help to access serial port in VB on windows XP. I am trying with Ports.bas but ididn't get success kindly anybody give code for access serial...
1
by: sjivanjee | last post by:
Help In Access 2007 - Report (Grouping and Sub Totaling) I have two table one stores student information and other one is for their attendance. In the attendance table their is a field called...
7
by: TinyTom | last post by:
I really need help with this code. I have made a pretty complicated subform that automatically updates filter criteria based off of inputs in various fields within the search form. What I need to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.