473,467 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need A97 code/query help.

pw
Hi,

I am having a mental block trying to figure out how to code this.

Two tables:

"tblQuestions" (fields = quesnum, questype, question)
"tblAnswers" (fields = clientnum, quesnum, questype, answer)

They are related by quesnum and questype. There are records in
tblAnswers for multiple clientnums.

What I need to do is to get every record from tblQuestions into the
tblAnswers table for every clientnum that is in the tblAnswer table.

Rats, I thought by typing out the problem I would have solved it but
nothing! :-)

Any ideas?
-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #1
3 1829
pw <***paulwilliamson@***spamcop.net> wrote in
news:tu********************************@4ax.com:
Hi,

I am having a mental block trying to figure out how to code
this.

Two tables:

"tblQuestions" (fields = quesnum, questype, question)
"tblAnswers" (fields = clientnum, quesnum, questype, answer)

They are related by quesnum and questype. There are records
in tblAnswers for multiple clientnums.

What I need to do is to get every record from tblQuestions
into the tblAnswers table for every clientnum that is in the
tblAnswer table. Rats, I thought by typing out the problem I would have solved
it but nothing! :-)

Any ideas?
Before I tell you how, I'm gonna tell you "Don't do it!'
You can just create the select queries and use it instead of
doing the additional steps.

First thing to do is create a select query with unique clientnum
as a parameter, and the tblquestions, then create a second query
with this query left joined to the tblAnswers on clientinum and
quesnum. You should not need any join on questype.

run the query, and note that you have all the questions and that
the unanswered questions have nothing in the answer field.

That's as far as you need to go.
Now to actually add the fields into the answers table, create a
new query with only the clientnum field, and the distinct values
property set to yes.

open the first select query, add the query with the clientnum
field, and change the original clientnum parameter to the
clientnum field. don't make any relation to the new field,

Now go to the second query, and add a condition to the answer
field, type IS NULL. without quotes.

If you run this query now, you will see a list of all the
unanswered clientnum-quesnum combinations.

Now create an append query based on this query that writes the
clientnum, quesnum, questype and "NO ANSWER" to the tblanswers.
Bob Quintal
..

-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure
Usenet News==---- http://www.newsfeed.com The #1 Newsgroup
Service in the World! >100,000 Newsgroups ---= 19
East/West-Coast Specialized Servers - Total Privacy via
Encryption =---


Nov 12 '05 #2
pw
>pw <***paulwilliamson@***spamcop.net> wrote in
news:tu********************************@4ax.com :
Hi,

I am having a mental block trying to figure out how to code
this.

Two tables:

"tblQuestions" (fields = quesnum, questype, question)
"tblAnswers" (fields = clientnum, quesnum, questype, answer)

They are related by quesnum and questype. There are records
in tblAnswers for multiple clientnums.

What I need to do is to get every record from tblQuestions
into the tblAnswers table for every clientnum that is in the
tblAnswer table.
Rats, I thought by typing out the problem I would have solved
it but nothing! :-)

Any ideas?


Hi Bob!
Before I tell you how, I'm gonna tell you "Don't do it!'
I was hoping someone would show me something different!!
You can just create the select queries and use it instead of
doing the additional steps.

Nice! My weakness! Always writing code I am! That is one great
feature about Access that I love: The query builder!
First thing to do is create a select query with unique clientnum
as a parameter, and the tblquestions, then create a second query
with this query left joined to the tblAnswers on clientinum and
quesnum. You should not need any join on questype.

run the query, and note that you have all the questions and that
the unanswered questions have nothing in the answer field.

That's as far as you need to go.


Sounds good!
Now to actually add the fields into the answers table, create a
new query with only the clientnum field, and the distinct values
property set to yes.

open the first select query, add the query with the clientnum
field, and change the original clientnum parameter to the
clientnum field. don't make any relation to the new field,

Now go to the second query, and add a condition to the answer
field, type IS NULL. without quotes.

If you run this query now, you will see a list of all the
unanswered clientnum-quesnum combinations.

Now create an append query based on this query that writes the
clientnum, quesnum, questype and "NO ANSWER" to the tblanswers.
Bob Quintal
.


This is good stuff Bob! I'll try it out 1st thing in the morning.
Thanks a lot!

-paul
-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #3
pw
Hi Bob
Before I tell you how, I'm gonna tell you "Don't do it!'
You can just create the select queries and use it instead of
doing the additional steps.

First thing to do is create a select query with unique clientnum
as a parameter, and the tblquestions,


I don't know how to specify a unique field in the Access97 Query
designer.
then create a second query
with this query left joined to the tblAnswers on clientinum and
quesnum. You should not need any join on questype.
clientnum is only in the answers table so I can't join on it.


run the query, and note that you have all the questions and that
the unanswered questions have nothing in the answer field.

That's as far as you need to go.
Now to actually add the fields into the answers table, create a
new query with only the clientnum field, and the distinct values
property set to yes.

I don't have a distinct value property in the Access 97 query
designer.

Thanks,
open the first select query, add the query with the clientnum
field, and change the original clientnum parameter to the
clientnum field. don't make any relation to the new field,

Now go to the second query, and add a condition to the answer
field, type IS NULL. without quotes.

If you run this query now, you will see a list of all the
unanswered clientnum-quesnum combinations.

Now create an append query based on this query that writes the
clientnum, quesnum, questype and "NO ANSWER" to the tblanswers.
Bob Quintal
.

-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure
Usenet News==---- http://www.newsfeed.com The #1 Newsgroup
Service in the World! >100,000 Newsgroups ---= 19
East/West-Coast Specialized Servers - Total Privacy via
Encryption =---


-pw
remove astericks (*) from e-mail address
(use paulwilliamson at spamcop dot net)
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #4

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

Similar topics

2
by: lawrence | last post by:
I've been bad about documentation so far but I'm going to try to be better. I've mostly worked alone so I'm the only one, so far, who's suffered from my bad habits. But I'd like other programmers...
12
by: jason | last post by:
Access 2000: I have a customer-inventory table I need to loop through and compile a list of all the inventory items the customer is tracking. The problem I am finding is that a simple loop...
9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
2
by: Paul Mendez | last post by:
I really need some help Date Code ConCAT Bal_Fwd NS_Fees Amt_Coll Cur_End_Bal 1/15/2004 KW 11KW2003 $500.00 $250.00 $250.00 2/15/2004 KW 12KW2003 $300.00 $500.00 ...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
8
by: pamelafluente | last post by:
I am beginning aspNet, I know well win apps. Need a simple and schematic code example to start work. This is what I need to accomplish: ---------------------- Given button and a TextBox on a...
1
by: write2ashokkumar | last post by:
hi... i have the table like this, Table Name : sample Total Records : 500000 (Consider like this) Sample Records: id ------------ name
0
by: savage678 | last post by:
Hi Everyone, I am new to this forum and am i dire need of some help. I am trying to use wildcard searches in infopath. I have it connected to an access database using data connection. I have...
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
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...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.