Transfer Text

=TB=

Registered User.
Local time
Today, 19:48
Joined
Aug 13, 2002
Messages
68
I am using the following code to transfer text

Code:
Private Sub cmdImportSerials_Click()
DoCmd.TransferText acImportFixed, "ImportSerial", "tblSerialNumber", Application.CurrentProject.Path & "\serial.txt", False
Me.Refresh
End Sub

This works fine, the code is executed via a button on a form and the imported text is show within a subform however I want to create a parent child relationship to the imported text so that when the user imports text from a new record on the main form, that imported text stays related to that main record. I have to fields within the 2 tables related but I just can't seem to to figure out how to get the main forms PK into the FK field within the table when text is imported.

Can anyone point me in the right direction

TIA
 
Last edited:
Thanks for the reply.

I managed to achieve what I wanted by using the table the text was transfered too as a temporary table then using vba I appended the fields I wanted to a permanent table and picked up the current main forms PK and appended that, then finaly deleted the records within the temporary table with code.

The me.refresh was picked up from my original code (did not realise I had copied and pasted it) where I needed to refresh the form after the transfer to show the transfered text in the subform. Did I still not need to use it in this situation?

Thanks again
 

Users who are viewing this thread

Back
Top Bottom