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

How to modify qryOwnerList to not show John Doe record?

MLH
On the outside chance that there IS some poor sucker out
there named John Doe, Jane Doe or Richard Roe, I'm allowing
them to be entered in tblOwners. I need a work-a-round though.
Help me out here.

I have a qryOwnerList containing no calculated fields - just lists
tblOwner records by last name first first name middle name last -
you know.. frmEditOwners uses qryOwnerList, sorting owners in
a manageable fashion. I do not wish for the John Doe record to
appear in the list unless the poor guy is really named John Doe.

So, I'm modifying qryOwnerList from

SELECT tblOwners.OwnerID, [OwnerFName] & " " & [OwnerLName] AS Owner,
[OwnerAddr] & " " & [OwnerCity] & ", " & [OwnerState] & " " &
[OwnerZip] AS Address, tblOwners.OwnerPhone, tblOwners.OwnerLName,
tblOwners.OwnerFName, tblOwners.OwnerAddr, tblOwners.OwnerPObox,
tblOwners.OwnerCity, tblOwners.OwnerState, tblOwners.OwnerZip,
tblOwners.OwnerSSN, [OwnerCity] & ", " & [OwnerState] & " " &
[OwnerZip] AS OwnerCSZ, tblOwners.Corporation
FROM tblOwners
ORDER BY tblOwners.OwnerLName, tblOwners.OwnerFName;
to

SELECT tblOwners.OwnerID, [OwnerFName] & " " & [OwnerLName] AS Owner,
[OwnerAddr] & " " & [OwnerCity] & ", " & [OwnerState] & " " &
[OwnerZip] AS Address, tblOwners.OwnerPhone, tblOwners.OwnerLName,
tblOwners.OwnerFName, tblOwners.OwnerAddr, tblOwners.OwnerPObox,
tblOwners.OwnerCity, tblOwners.OwnerState, tblOwners.OwnerZip,
tblOwners.OwnerSSN, [OwnerCity] & ", " & [OwnerState] & " " &
[OwnerZip] AS OwnerCSZ, tblOwners.Corporation, [OwnerFName] &
[OwnerLName] & [OwnerState] & [OwnerZip] AS asdf
FROM tblOwners
WHERE ((Not ([OwnerFName] & [OwnerLName] & [OwnerState] &
[OwnerZip])="JohnDoeXXxxxx"))
ORDER BY tblOwners.OwnerLName, tblOwners.OwnerFName;
and I'm wondering if there is, perhaps a more elegant way. The
app is useful only in the US. Here, we have no state abbreviated
XX or zip code of xxxxx. So, the SQL does the trick
Feb 11 '06 #1
4 1218
MLH <CR**@NorthState.net> wrote:
<snip>
: I have a qryOwnerList containing no calculated fields - just lists
: tblOwner records by last name first first name middle name last -
: you know.. <snip>

: So, I'm modifying qryOwnerList from

: SELECT tblOwners.OwnerID, ...<snip>

: to

: SELECT tblOwners.OwnerID, ...<snip>
: WHERE ((Not ([OwnerFName] & [OwnerLName] & [OwnerState] &
: [OwnerZip])="JohnDoeXXxxxx"))
: ORDER BY tblOwners.OwnerLName, tblOwners.OwnerFName;
: and I'm wondering if there is, perhaps a more elegant way. The
: app is useful only in the US. Here, we have no state abbreviated
: XX or zip code of xxxxx. So, the SQL does the trick
Shorter, but not elegant.
If you've actually assigned him to state 'XX', then that's all
your WHERE needs to test for
WHERE ( Not ([OwnerState] = "XX"))
...so you're not restricting state to the 50 valid abbreviations
--thelma
Feb 11 '06 #2
You haven't supplied sufficient information. What you are proposing makes
little sense.

Why is there an invalid "John Doe" record in your table in the first place?
Are you saying that you also have an invalid "Jane Doe" record? How many
other invalid records?

Doesn't your table have a primary key? It should! Use it!

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
"MLH" <CR**@NorthState.net> wrote in message
news:qj********************************@4ax.com...
On the outside chance that there IS some poor sucker out
there named John Doe, Jane Doe or Richard Roe, I'm allowing
them to be entered in tblOwners. I need a work-a-round though.
Help me out here.

I have a qryOwnerList containing no calculated fields - just lists
tblOwner records by last name first first name middle name last -
you know.. frmEditOwners uses qryOwnerList, sorting owners in
a manageable fashion. I do not wish for the John Doe record to
appear in the list unless the poor guy is really named John Doe.

So, I'm modifying qryOwnerList from

SELECT tblOwners.OwnerID, [OwnerFName] & " " & [OwnerLName] AS Owner,
[OwnerAddr] & " " & [OwnerCity] & ", " & [OwnerState] & " " &
[OwnerZip] AS Address, tblOwners.OwnerPhone, tblOwners.OwnerLName,
tblOwners.OwnerFName, tblOwners.OwnerAddr, tblOwners.OwnerPObox,
tblOwners.OwnerCity, tblOwners.OwnerState, tblOwners.OwnerZip,
tblOwners.OwnerSSN, [OwnerCity] & ", " & [OwnerState] & " " &
[OwnerZip] AS OwnerCSZ, tblOwners.Corporation
FROM tblOwners
ORDER BY tblOwners.OwnerLName, tblOwners.OwnerFName;
to

SELECT tblOwners.OwnerID, [OwnerFName] & " " & [OwnerLName] AS Owner,
[OwnerAddr] & " " & [OwnerCity] & ", " & [OwnerState] & " " &
[OwnerZip] AS Address, tblOwners.OwnerPhone, tblOwners.OwnerLName,
tblOwners.OwnerFName, tblOwners.OwnerAddr, tblOwners.OwnerPObox,
tblOwners.OwnerCity, tblOwners.OwnerState, tblOwners.OwnerZip,
tblOwners.OwnerSSN, [OwnerCity] & ", " & [OwnerState] & " " &
[OwnerZip] AS OwnerCSZ, tblOwners.Corporation, [OwnerFName] &
[OwnerLName] & [OwnerState] & [OwnerZip] AS asdf
FROM tblOwners
WHERE ((Not ([OwnerFName] & [OwnerLName] & [OwnerState] &
[OwnerZip])="JohnDoeXXxxxx"))
ORDER BY tblOwners.OwnerLName, tblOwners.OwnerFName;
and I'm wondering if there is, perhaps a more elegant way. The
app is useful only in the US. Here, we have no state abbreviated
XX or zip code of xxxxx. So, the SQL does the trick


Feb 12 '06 #3
MLH
Yes, I guess you're right, Thelma. I guess you're right.

What I have is a one-to-many relationship between
tblOwners and tblVehicles - an owner could own any
number of vehicles in tblVehicles. Occasionally, we
acquire a vehicle for whom there is no owner that can
be determined. This is the exception, rather than the
rule. My reason for creating 1 single John Doe record
in the owners table is that having that record there
eliminates the need for a lot of other red tape throughout
my application. It hurts nothing, really. And I never had
to bother with Nz or checking whether the OwnerID field
was Null for any given vehicle before attempting to do
something with the value.

The John Doe record is not created until a vehicle w/
no owner is acquired. And, of course, it never has to be
added again - ever. And no, I have no defined relationship
from a tblStates to the OwnerState field in tblOwners. For
maintaining referential integrity, I do DLookUps of the state
abbreviations in a zip code table after the user completes
the zip field (at the form level) and I offer no direct table
access otherwise. The integrity of that smidgen of data
just doesn't make or break the app in any significant way.
If a guy wants to enter ZP for some state abbrevation after
I've done a dlookup & filled in the correct 2-char state code -
well, that's his loss. Hasn't happened yet in about 37000
records spread over 70 separate runtime installations that
I know of. So I'm not losing much sleep over it.

Thx for the pointer.


Shorter, but not elegant.
If you've actually assigned him to state 'XX', then that's all
your WHERE needs to test for
WHERE ( Not ([OwnerState] = "XX"))
...so you're not restricting state to the 50 valid abbreviations
--thelma


Feb 12 '06 #4
MLH
>You haven't supplied sufficient information. What you are proposing makes
little sense. Sorry, Randy. It happens.
I have this table (tblOwners) and it consists mostly of valid names of
real persons who own vehicles (stored separately in tblVehicles). Once
in a while, we add a rec to the vehicles table that has no owner.
Although its perfectly acceptable to have a vehicle record with no
related owner record, we have introduced John Doe - a nonexistent
person who has a name. This works out quite well for the legal reports
that we auto-fill from our stored data. In most courts, John Doe is
the legal name in which an unknown owner (one whose records
cannot be obtained from the DMV) is sued under. The courts, of course,
never expect John to have an address - works perfectly for us.

Why is there an invalid "John Doe" record in your table in the first place?
Are you saying that you also have an invalid "Jane Doe" record? How many
other invalid records? No Jane Doe's. Just John. I was just throwing in Jane Doe and Richard
Roe for emphasis.
Doesn't your table have a primary key? It should! Use it!


Feb 15 '06 #5

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

Similar topics

1
by: Franco Fellico' | last post by:
Hi. Suppose to have read and displayed (using PHP) a group of row of a DB table on a dinamyc table on a HTML/PHP page. The number of row displayed could be from 1 to n. Each row contains...
12
by: Venkat | last post by:
Greetings to All, I have the following file and i need to modify it with the contents of an array File1.txt Name Location Points Grade Venkat,Newyork,100,A Jack,LA,12,C
2
by: John Baker | last post by:
Hi: I have a sub form which i would like to show all the records selected from a table. There may well be over 100 of them. For reasons I cant fathom, the form will only show six, and then...
1
by: Henry | last post by:
Hi. I've been trying to modify my dataset and have been unsucessful. Any help would be great. What I have is a dataset in a session variable. Here is what I have done to stored into the dataset...
15
by: RBCC | last post by:
How do I modify a record in a textfile in vb? Do I need 2 files? JOhn --- Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website:...
19
by: UAlbanyMBA | last post by:
How does a Record Set order the when there is redundancy? The example I have is if you search a DB for a customer, but there are two or more customers with the same name, i.e John Smith. I want to...
7
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent...
2
by: John Sheppard | last post by:
Hello there, I have a report with a subreport on it. The subreport is meant to show multiple child record for each master record. But it only shows the first record. When I open the subreport...
1
by: Steve | last post by:
This may be a dumb questions please forgive I have a form that shows a list box that links to a table with 7 employee names The form does not show employee key. When adding record to master...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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
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...

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.