Record ID Problem-Access 2007

  • Thread starter Cipher via AccessMonster.com
  • Start date
C

Cipher via AccessMonster.com

I have a Text File which is read-in by a Form. Because I have no unique field
in the file, I allow Access to add a Record ID when it is read in to the Form.
Everything works OK except when I read the Form out back into the text File
as it wants to ADD the Record ID.

Is there a way of "Selecting" the fields I save back to the Text File?
Additional records will be added to the Text File after it has been edited by
the Form.

You would expect the following from Access:
1) The original Text File does not have the unique field because it is not
necessary.
2) Access adds the additional RecordID so that the Table can uniquely
manipulated.
3) WHY THEN is it not possible to write back to the original Text File
'WITHOUT' the added RecordID?

Either, this can be done, or Microsoft has chosen another location to show
its stupidity...which is it?
 
J

John W. Vinson

Either, this can be done, or Microsoft has chosen another location to show
its stupidity...which is it?

It can be done easily. Create a query based on the table, and select all the
fields EXCEPT the ID; and export *that query* to the external file.
 
C

Cipher via AccessMonster.com

Thank you John. I am wondering though, I am asking my customer to do many
things here and I am not sure if he is capable and/or even wants to do all
this.

He likes the idea of using a Form to edit the information in the external
Text Files, but he really needs a 'button' on the form to do all of this.
Would it be easier to generate some code within the Form to export just the
required firlds back into then external files. Is "TransferText' the right
direction or is there an easier way. Again, thanks for the comeback.
 
J

John W. Vinson

Thank you John. I am wondering though, I am asking my customer to do many
things here and I am not sure if he is capable and/or even wants to do all
this.

He likes the idea of using a Form to edit the information in the external
Text Files, but he really needs a 'button' on the form to do all of this.
Would it be easier to generate some code within the Form to export just the
required firlds back into then external files. Is "TransferText' the right
direction or is there an easier way. Again, thanks for the comeback.

Sure. Do the structures of the text files change, or are they all basically
the same? If they're all the same you could create and save the query omitting
the ID field, and use the TransferText method *on the query* to export it.

If you have no way to predict or control the number and names of the fields,
it'll be trickier, but you should still be able to build the query in code and
run it.
 

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