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

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 1815
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.