Default Value question

D

David

Hello

I am importing data to a single table from multiple text files using a macro
and it is importing beautifully.
One piece of information is a required field but is not part of the file I
am importing.

I have a form with a combo box for the various selections that can go into
that field.

Can I have the value set to "A" for the first list I import and "B" for the
second list.

David
 
K

Ken Snell \(MVP\)

What I would do is this:

1) Import the first text file to an empty temporary table.

2) Run an append query to copy the data from the first table to the
permanent table. Include a calculated field in this query that provides the
value of "A" for all records.

3) Delete all records from the temporary table.

4) Import the second text file to the empty temporary table.

5) Run an append query to copy the data from the first table to the
permanent table. Include a calculated field in this query that provides the
value of "B" for all records.

6) Delete all records from the temporary table.
 
D

David

How do I do step 2?
I haven't used append queries before and I just don't know how to include a
calculated field.
 
D

David

I got it. Thanks a Bunch!

David

Ken Snell (MVP) said:
What I would do is this:

1) Import the first text file to an empty temporary table.

2) Run an append query to copy the data from the first table to the
permanent table. Include a calculated field in this query that provides the
value of "A" for all records.

3) Delete all records from the temporary table.

4) Import the second text file to the empty temporary table.

5) Run an append query to copy the data from the first table to the
permanent table. Include a calculated field in this query that provides the
value of "B" for all records.

6) Delete all records from the temporary table.
 

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