Problem with importing records

S

selgin

Dear All



I have a database that is to get information from doctors offices on
specific patients. I import a text file that has info including an item
number. Based on this item number I want to ask certain questions of the
doctor.



i.e. if it is item number 0001 I want to ask questions 1, 3, 9 and 33, if it
is 0002 I want to ask questions 1, 4, 8 and 20. I have this working if the
patient has only one item.



My major problem is that a patient may have more than one item number but I
need to only ask question 1 once for a patient on the request to the doctor.



I currently have a questions table (which has the questions in a text field
and an autonumber id field (PK) and the id field from the import table (FK),
an import table (where the text file is initially imported to), a and a
bunch of others that I have created in attempting to get this to work.



TIA for any kind of help on this!!



Steve
 
L

Larry Daugherty

You might use an array that can hold the maximum number of questions that
could require answers. Run through your input items setting each question
each item needs answered to "X", When you have completely processed the
input you can scan the array. Each value that holds an X must be answered
so that value is appended to your questions list. Watch the zero and 1
based issues in your array

HTH
 
M

MacDermott

I'd suggest a table with item numbers and question numbers.
(PK can be a combination of both fields)
I'll call it tblQuestionsForItems

Now you can write a query which connects your Imports table to
tblQuestionsForItems, using the ItemID to link on.
Return the PatientID and QuestionID fields.
This will give you the questions for each patient, but you may have
duplicates.
Here's how you can address that: Open the Properties Sheet for the
query. Set the UniqueValues property to Yes.
Now when you run the query, you should get just a unique set of questions
for each patient.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top