Query Problems

 I have a table of ecards that is populated from a website and includes 
receiver, sender, and Team leader. The problem I am having is names can be 
entered into the table like this "Tom Thumb", but Team leader is a dropdown 
menu that is constant and lists name like this: "Tom S. Thumb". When I make a 
query to find all the members of Tom S. Thumb's team, I get everyone except 
Tom Thumb, who is member too. Tom Thumb has his own higher team leader, so I 
can't change that. How do I get Tom Thumb to be included when I enter "Tom S. 
Thumb" as Team Leader?
0
Utf
8/13/2007 4:30:03 PM
access 16762 articles. 3 followers. Follow

2 Replies
857 Views

Similar Articles

[PageSpeed] 1

Dear "trainsteve",

Why are you saving the Team Leader Name instead of a index value that can be 
used to get the Team Leader Name from a Team Leader Table? Save storage space 
and eliminate the chance of spelling errors.

You say you have a drop down for Team Leader,  is it driven (getting it's 
source data from) from a Team Leader Table?

Maybe you need to look at your database design and do some more work on that 
to resolve this problem?

If each Team Leader had a unique(index) number, than you could select based 
on that number (no spelling to worry about). 
 
Steve


0
Utf
8/13/2007 7:22:06 PM
On Aug 13, 12:30 pm, trainsteve <trainst...@discussions.microsoft.com>
wrote:
>  I have a table of ecards that is populated from a website and includes
> receiver, sender, and Team leader. The problem I am having is names can be
> entered into the table like this "Tom Thumb", but Team leader is a dropdown
> menu that is constant and lists name like this: "Tom S. Thumb". When I make a
> query to find all the members of Tom S. Thumb's team, I get everyone except
> Tom Thumb, who is member too. Tom Thumb has his own higher team leader, so I
> can't change that. How do I get Tom Thumb to be included when I enter "Tom S.
> Thumb" as Team Leader?


Steve's advice about table structure is very important.  It will save
you much grief in the future.

Following that, the way to structure your query would be something
like (air code...)

SELECT employeeID
FROM tblEmployees
WHERE leadID = forms!dummyFormName!dummyComboBoxName.column(0)
  OR employeeID = forms!dummyFormName!dummyComboBoxName.column(0)

The source of your combobox should be a query which just shows the
team leads from the employees table.  This could be done with a query
something like (again, air code) - note that this goes in your
combobox's rowsource

SELECT DISTINCT employeeID, firstName & " " & lastName
FROM tblEmployees
WHERE employeeID IN (SELECT teamLeadID FROM tblEmployees)

Here, the teamLeadID is actually an employeeID, and hence points to
one of the entries in tblEmployees.  This second query is not
particularly fast, so someone else may have a better suggestion.  If
you have a table listing team leads (which you probably should) then
you should use that as your combobox's rowsource.  Preferably, that
other table would use the same employeeID field as tblEmployees as its
key, though there could be a good reason not to do that.

Hope this helps,
Daniel

0
Daniel
8/13/2007 9:00:51 PM
Reply:

Similar Artilces:

Problem
Ever since I added a Microsoft Exchange Server Account and all it6s associated folders and its in-box to my pre-existing Personal Outlook 2003 POP3 folders, I have had nothing but confusion. The Exchange Server account from my workplace downloads its messages into the in-Box for my private ISP POP3 account and vice versa. When I try to configure a rule for my personal POP3 account so that any messages addressed to my workplace account are loaded into the exchange server in-box on my client PC, the software tells me I have to go on-line to Exchange Server - even to create rules for th...

date problem #10
Thanks a lot, Dave This piece of code works great. M P Redd -- mpredd ----------------------------------------------------------------------- mpreddy's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1327 View this thread: http://www.excelforum.com/showthread.php?threadid=26358 ...

Problem changing parent Business unit
WE have re-arranged some business units into a more appropriate hierarchy, however, we have noticed that a user in a role with deep privileges (own business unit and children I think) to read users can only see users in his own business unit and only one of the child business units (there are 2 child business units). We cannot enable him to see all the users in both child business units. We tried reassigning the parent business unit to the one child that is not appearing, but it doesn't seem to make any difference. WE also tried adjusting the privileges up and down (i.e. Global and local...

create new users STRANGE problem
Hi, I'm developing a web application (using standard asp and not asp.net) to let certain remote users administer exchange 2003. I have installed win2003 standard edition, exchange 2003 enterprise edition,owa and my web application on the same server. My web app, let users to create mailboxes, delete mailboxes, change user password. All works fine, but for example, if I reboot the server, a web application user can create 50 mailboxes. But when any of these users log on to owa, something goes wrong and the admin user cannot mailbox enable other user accounts through the web app, even if he ...

Problem w/ Outlook
I'm running Office XP and all of a sudden I can't move messages to other folders not delete messages from my Inbox. It doesn't give me a specific error code, just suggests that I restart Outlook. I've tried that with no success. I went to ControlPanel and repaired my Office installation. Any ideas? Eudora is looking beter all the time. ...

ProbleM: when I restore a mailbox using Exmerge with a pst file, nothing is transferred.
Hi, I am practising Exmerge for a big remote site migration in a couple of weeks. One thing I dont understand is that I can backup one test mailbox fine using Exmerge (I know this works, as I have opened the mailbox pst file within outlook and everything is there), but when I perform the restore using the pst file, nothing happens. There is no error messages, and Emerge goes through the motions (though it finishes supsiciously quick), but when I open the mailbox, no emails have been restored. Although it is great that Exmerge is working for the backup part of the stage, I am disappointed it i...

Problems with Outlook 2003
This only happens with externally sent messages. Internal messages work fine. One of my users alerted me to this issue, so I tested this myself. I created 2 messages (internal and external) and added delayed delivery to both. They were both set to go out at the same time. The internal message went, and the external message is still in the outbox. The user who alerted me to this found her message went "before" the scheduled time.We are not running in cached mode and of course running Outlook on Exchange. Is this a bug? ...

memory problem of Excel 2003 copy & paste
Hi all, I am using Excel 2003 for some project. I am having 2GB C drive harddisk space. After a while, the Excel begins to be extremely slow in copy and paste... It takes about half an hour to copy and paste just a few cells... I've consulted people. It seems a memory problem. But I cannot close my windows and kill the processes, because I am running long-running (overnight) jobs... I cannot reboot either. Is there a way to clean the memory and let Excel 2003 clipboard function properly without rebooting or killing my 4 long-running processes? Thanks! p.s. I am sure this is an is...

Windows XP Shared PC
We are using Outlook 2000. The PC, which already had Microsoft Office 2000 loaded on it, was upgraded from Win 98 to Win XP. I then created Windows XP logons for all four people that will be sharing this PC. When I did, the Outlook shortcut automatically ended up on the desktop of each person when they individually logged in. When I clicked the shortcut the first time I went in to each person's desktop, I setup the mail account for JUST THAT PERSON. And when I go back and log into each person's desktop it still shows ONLY THEIR ACCOUNT. However, whatever mail they receive ALS...

Public Folder/OWA problem
We're running a pure Ex2k3 environment. I'm trying to setup a public folder where end-user software can be posted. This way, users can access our front-end OWA server outside of the network, open public folders, and then save the software to their local PC. The problem is that i get a "403 Forbidden" error whenever i try to download the file off of OWA. I checked that users had all permissions to the folder.. I found this TechNet article that describes something very similar (http://support.microsoft.com/kb/834743/en-us). The only problem is that it refers to som...

Shared workbook and VBA problem
Shared workbook and VBA problem Hi Group, I am new at this Excel stuff and I am hitting my head on a silly problem that I am sure many have seen before. I wrote a very simple spreadsheet where I use the Calendar control to pick some dates. Everything was fine until I decided that I needed to share it on the network with other users. As soon as I share it the calendar control stops working. I get a "runtime error 1004, unable to set left property of oleobject class". That's because the first thing I try to do is position the calendar. If I don't do that, it still doesn't...

outlook express 6 password problem
Help I have outlook express 6, windows xp. My internet provider just changed from att broadband to comcast. now i keep getting a password rejected error and i cant receive any mail. i cant seem to find a way to shut off the password. in my wifes page of xp it works ok. Hi, Bill - This is a group to support Outlook from the Office group of programs. Outlook Express is a part of Internet Explorer and is a quite different program, despite its similar name.. You will probably get a faster and more expert answer if you post this to an Outlook Express news group. Try posting in one of these n...

Problems Recieving Emails
I have two accounts one for me and one for the better half. I have them set up on outlook correctly . The problem is I can only down load the wife's email using out look express. I also use Mail Washer to wash the crud out and it does not see the email either although it logs on to the accounts. Cox is my ISP. I have discussed it with them and the answer was to take it up with Microsoft, but that was a waste of time as they have not found any cause for the action. Any ideas of the problem would be kindly accepted. 1. Version of Outlook? 2. Separate mail profiles? 3. Separate Windows L...

Hebrew Oulook problem solved
Removing the com add-in Outlook Attachment remover solved the problem. ...

Crystal Reports problem 07-11-05
Hi, Client was seeing the usual logon problem when trying to access reports. Tried re-starting all services and this error disappeared but now isn't showing any reports at all. Checked all the files and databases and can't see where the problem is - any suggestions please. By the way this is post install - no one has yet been prompted to install the activex viewer. Hello Pete, This could be Active Directory related. Could you check you added the Microsoft CRM server and the SQLServer computer to the Pre-Winodws 2000 Compatible Access group? This solved a number of problems at ...

Date Problem #2
Hi All Please can someone advise me what to do, I have a date in a textbox where I am using the AddDate method to increment the day , but I am getting strange results. Is this because the US date? if so how do I change this to work for the UK date? Any help would be greatly appreciated regards Subs Hiya- i'm not sure what formula you're using- I put a random date in A1 and pasted the following formula in B1 & C1: =DATE(YEAR(A1),MONTH(A1),DAY(A1)+1) it increased the day by 1 in both cells. I then changed the format to UK and it worked just fine. Is this what you're l...

clip art preview problem
I just downloaded the new microsoft security pack and now my Clip Art function on all of my office programs will not display a preview from the Online Clip Art search program. I know it searches because lots of boxes come up and some of them will insert and show up in my document if I double click them. but I can't spend all of my time inserting them into my document to see if they are the ones I want. A few times the Office Assistant has said that a picture is not available because I do not have the right graphic converter and to press help for more info - that just takes me in ...

two sets of parameters..one query...but how?
I have a query to track when I must renew State Police Clearances AND Child Abuse Clearances. I want to use the "Between [date] and [date]" function on BOTH of the fields in order to bring up BOTH sets of dates for BOTH clearances.The problem I am running into is that when the query results come up, if one date doesn't meet the criteria NONE of the information comes up (even if the other date DOES).Any suggestions!??!?! Thanks in Advance....

Paying Bills
Hello, I have two accounts that go to the same payment service for payment. I can only create one bill for the first account # I do not see how to add a second bill for my second account # Is there a way around this? Thanks Frank Money 2004 Yes. Use different payees like MasterCard {hers} and MasterCard {his}. The braces ant their contents make this work and suppress the contents when, say, printing a check. "Frank" <farocco@hotmail.com> wrote in message news:Oln2RCfQEHA.620@TK2MSFTNGP10.phx.gbl... > I have two accounts that go to the same payment service for paymen...

IE8 Tab Problem
Is there a way to get all the tabs I am using in a session to show the next time I open my browser? In IE7 whatever tabs I was using I had it set to open them all up the next time I used my browser but IE8 doesn't allow that option. Is there a work around? Had I known this was not a feature I wouldn't have been dumb enough to click on the download when I was on Facebook as the way it is set up now is not convenient. Appreciate any answers you may have. Thanks. If you click on downloads in Facebook, you /are/ dumb. But I'll bet you're smart enough to us...

Office X
I'm currently a student, so I want to take advantage by buying the student version of office. But...am I correct in fearing that this version will be restricted from upgrading to future versions? I just don't want to get screwed by Microsoft and I haven't found any documentation on line that indicates any difference whatsoever between the standard and student versions aside from pricing and packaging. But something tells me that I should play it safe and go with the standard version for the sake of the future. What do you think? - Nolan In article <65970378.0310111127.62470f44...

Formatting Problem
I've created a blank booklet of x no. of pages with page size of h7.25" x w4.75" with 0.5" margins all around. I've been provided with material on floppies to incorporate into the booklet. The material is in the wrong font type and size and needs considerable change in other formatting. This I've done by opening the document into a WORD document of the same dimensions as stated above and tailoring the content to this WORD document. There are some centering, indents, right or left alignment. When I then try to insert this into the booklet in Publisher, s...

Newbie with Panel & User Control Query
Hi All, Firstly, im a real newbie to C# so appologies for asking what might be a very basic question. Basically im using DotNetBar and have a Ribbon form. On my Ribbon form, I have a ribbon Bar, With 5 buttons. I also have a a panel on my Main form (pnlMainMenu) I have serveral user controls also. When a user clicks on a button I would like it to display the user control in the Panel. So far i have the following code:- private void btnComplaints_Click(object sender, EventArgs e) { pnlMainMenu.Controls.Clear(); TestApp.User_Controls.uctComplaints = ...

Conversion to pdf file problem
I have MS Publisher 2007 and Windows XP. I created a document which will be printed on 11 x 8 1/2 paper (landscape style) and folded in half- booklet. The individual page is 5.5 x 8.268 and thus two pages are printed on one landscape sheet. I can use the Print Preview and the publisher document looks fine but when I convert and publish it to a pdf document, the pages are screwy. The pages are narrow with text cut off . What am I doing wrong? Are you using the *save as a PDF* add-in from Microsoft? How did your booklet lose a quarter of an inch? Try the add-in, see if it converts c...

Rounding problem #6
I have a series of 16 and 18 digit numbers that I am trying to store and work with. If for example I have the number 1234123412341234 and I leave the field unformatted I get '1.23412E+15' which is fine. If I change the cell formatting to 'number' w/o decimals I get '1234123412341230'. What has happened to my last '4'? Why is it now a cheeky '0'? This seems to happen with all digits after and including the 16th. Any help appreciated. Mark Although Excel can represent very large numbers (up to E309), it can only do so with 15 digit precision, so ...