473,659 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating an initial drop down list that will return just that person's information / Calculating Items

This may seem simple, but I'm having a bit of trouble figuring out
exactly how to do it. I'm accessing a database through an ODBC link,
and I have a query that returns only jobs completed that day (it's
automatically generated). 1 user may finish 10, 20, or 50 jobs a day,
but there can be at least 20-50 users per day, and they're always going
to be different. The users aren't going to return, or if they do, it's
always going to be under different names.

I need some way to, when a person clicks on a shortcut, have Access
create a drop down list that returns all distinct names from column
USERDEFINED1 from the query that returns only that day's jobs. Once the
person chooses a name, only those jobs that the person did that day
would be listed on the screen.

In a different question, is there also a way to have the costs of those
jobs (calculated by multiplying columns AQW and PRS for each job)
automatically calculated and totaled in a report with the ability for
me to add items if necessary?

For instance, user "Riker" has three jobs in the list. Job 1 is 1 job
at $10.00, Job 2 is 3 jobs at $5.00, and Job 3 is 4 jobs at $25.00. Is
it possible to add them all up so that it totals $125, but with the
ability to add additional items (all I need to do is add a description
and a total, no need for calculation here) such as: New CD - $30.00 so
that in the end, its final calculation is $155?

Sorry for asking so much. I'm looking through Google and other
websites, and I'm getting a bit confused. Any help is much appreciated!

Nov 13 '05 #1
5 2293
Sorry, I meant to say that I'm using Access 2000 as well.

Nov 13 '05 #2
What do your relationships look like? How is your Jobs table
structured?
From what you've described, you could have something like a

Main/Subform with Main being based on User/Worker and the subform being
based on Job. Then you could have a calendar control on your form and
filter your subform based on that...

Umm... unique values from jobs...

SELECT DISTINCT [SomeField]
FROM tbl_Jobs
WHERE tbl_Jobs.Assign Date=Date()
AND WorkerName=Form s!MyForm!cboWor kerName;

Can you add up the totals? Yeah, if you use DSUM and an unbound
control on your form... If you want to add additional items, just make
the subform (based on tbl_Jobs) to allow additions (that's the
default,anyway, so you shouldn't have to do anything).

If you have to change which field your query is returning then you
probably have some normalization problems with your data.

So post your structure (just the parts relevant to your question) -
something like:

CREATE TABLE Worker(
WorkerID Long PRIMARY KEY,
FirstName Text(50),
LastName Text(50),
.....);

CREATE TABLE Job(
JobID Long PRIMARY KEY,
ToWorkerID Long,
AssignDate Date,
Description Text(255),
Price Currency,
CompleteDate Date,
....
FOREIGN KEY (ToWorkerID) REFERENCES Worker(WorkerID );

If you do it basically like this, solving your problem is simple.
Otherwise, it could get ugly. And if you can't get answers out of your
database, you've built it wrong.... so make sure it's right before you
stuff it with lots of data.

OKay, return just that person's info.
- create a main form/subform with Worker as the Main form recordsource
and the Job as the subform recordsource.
- use the combobox wizard to create a combobox on the Main (Worker)
form, and have it go to the record specified in.
- If you need the total of the worker's open jobs, use DSUM.

CREATE TABLE Job
(JobID

Nov 13 '05 #3
The simplest method would be a Master/Child form combination.

1) Child: create a form and set its .DefaultView to 'Continuous Form'.
Bind the child's Form.RecordSour ce property to your daily detail level
data query. Be sure to include the primary key (evidently UserName) in
the RecordSource SQL statement. Add and format the fields you want to
see. Add a textbox to the Form footer area to your display the total
value.:

= Sum([JobAmount])

assuming 'JobAmount' is the name of the field with your detail order
amount.

3) Master: create another unbound form and add a comboBox. Set the
comboBox.Record Source to a SQL query that selects from the same data as
your Child form - GroupBy (and OrderBy?) the UserName. When you open
that form, each user name should appear once in the .comboBox dropdown.

4) Add a subform window to your Master form. Set the subform's
..SourceObject to your child form.Name. Set the .LinkMasterFiel ds to
your comboBox.Name, and the .LinkChildField s to the .UserName field in
the child form. You may need to resize the subform window to display
the records as you want to see them.

5) When you pick a UserName from the .comboBox, the related records
will be displayed in the subform. You should be able to scroll thru
each of the records or use the navigation buttons if you include them
in the child form's design. As long as the underlying recordset is
updatable, you will be able to edit or add records as needed. If you do
add a record, Access will add it to the underlying data source with the
UseName of the record currently in context in the .comboBox.. The total
textbox will display the total for the related records.

rock and roll,
King Ron of Chi

Nov 13 '05 #4
Thanks for both of your responses! I'm going to try this and report
what happens. Thanks again!

King Ron wrote:
The simplest method would be a Master/Child form combination.

1) Child: create a form and set its .DefaultView to 'Continuous Form'. Bind the child's Form.RecordSour ce property to your daily detail level data query. Be sure to include the primary key (evidently UserName) in the RecordSource SQL statement. Add and format the fields you want to
see. Add a textbox to the Form footer area to your display the total
value.:

= Sum([JobAmount])

assuming 'JobAmount' is the name of the field with your detail order
amount.

3) Master: create another unbound form and add a comboBox. Set the
comboBox.Record Source to a SQL query that selects from the same data as your Child form - GroupBy (and OrderBy?) the UserName. When you open
that form, each user name should appear once in the .comboBox dropdown.
4) Add a subform window to your Master form. Set the subform's
.SourceObject to your child form.Name. Set the .LinkMasterFiel ds to
your comboBox.Name, and the .LinkChildField s to the .UserName field in the child form. You may need to resize the subform window to display
the records as you want to see them.

5) When you pick a UserName from the .comboBox, the related records
will be displayed in the subform. You should be able to scroll thru
each of the records or use the navigation buttons if you include them
in the child form's design. As long as the underlying recordset is
updatable, you will be able to edit or add records as needed. If you do add a record, Access will add it to the underlying data source with the UseName of the record currently in context in the .comboBox.. The total textbox will display the total for the related records.

rock and roll,
King Ron of Chi


Nov 13 '05 #5
Thanks again for your help Ron and Pie.

I used a bit of your advice, but went a bit on my own.

I created a query that pulled all the unique names for that day. I then
created a list box that pulled that information and displayed it. Then,
I made a find query that had Like "*" & "*" in the criteria section.

I found out that you could create an action button that would run a
form. Well, I had a form made that was based on the find query. Then, I
made the button link between the list and the customer name so that the
unique names matched up with the customer name on the form. Finally, I
stripped the code from the button and added it to the OnClick Event of
the list. Now, I have a shortcut to that form on my desktop. I click
the shortcut, and a list of all the people who used the system today
appears. I click a person's name, and their receipt pops up,
automatically calculated and ready to go with all the jobs that they
had that day.

So now all I have to do is to figure out how to add values in a hidden
fashion so that I can have the "Add CD/Copies/Etc." option. Right now
when I try it, it says that I can't have null parameters for certain
fields. I'm thinking that if I have a big Add CD button that
essentially opens a new record, there's got to be code that I can
insert to have the other fields fill in (such as date at that second,
Username, etc...most of them can be filled by a fixed text variable)
automatically while leaving me the option to fill in the description
and price.

I'm thinking something in VBA will do this...perhaps an INSERT
statement, but since I don't know VBA, I have to keep searching the web
and Google Groups.

Thanks to all who helped!
Keith

Nov 13 '05 #6

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

Similar topics

46
5125
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") to populate a drop down but would like to use several drop downs restricting the contents of each drop down to the records pertaining to one
4
2022
by: Ronnie | last post by:
Ok let me just say first that I am a newbie in Access and I don't know much of SQL or VB programming. But I am trying to create this contact database using Access 97. I have created 2 tables, one Personal (it has all the personal information) and the other one Organization (this one has details of diff organizations). One person can belong to more than any (upto 5 in this case) organizations. So I included orgid1, orgid2, orgid3, orgid4...
13
5241
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data structures? Thanks for any hints, Leszek Taratuta
3
26298
by: Stephen Adam | last post by:
Hi there, I'm sure i'm missing something really simple here, all i want to do is get the value of the selected item in a list box. Even after much fiddling about last night I still could not get my code to work. Below is some code which highlights my problem. All I want to do is set the lable control's text property to the value of the selected drop down list value - in this example i've shown the three ways i've tried. Please help!
2
12612
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will select any skill in 1st drop down list then i'll select % of this skill in the 2nd list box , based on the percentage i've selected in the 2nd list box it has to display 2 sets of drop down list boxes at run time one for selecting skill and
5
4219
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1); System.Data.SqlClient.SqlCommand dbCommand1 = new System.Data.SqlClient.SqlCommand();
4
1518
by: Laura K | last post by:
I have a drop down menu which has a list of subcategories and the initial value is "please choose a Subcategory". When the user chooses a subcategory they are taken to a new page where the drop down list shows the selected subcategory in the menu. So far that is working. The problem is that when the list is showing the subcategory on the second page there are now two of that item in the list and the initial item that should be available...
5
12237
by: Ajith Menon | last post by:
I need to select multiple entries in the drop down list. E.g. Search a string in languages like C#, VB, Java etc. These entries are in drop down. So i need to multi select to search in multiple languages 1. One of the option could be to have a check box beside each entry in drop down. Do any one have an idea how to do this. Solution in C# is required but even if its unmanaged code is OK.
4
9287
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me if it works, and if it does not, tell me why it does not work. Thanks.
0
8427
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8746
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8626
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6178
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
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 we have to send another system

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.