I cannot access infor from a subform.

T

Themba

I am working on Access 2003.
I have two tables with a one to many relationship, and I have created a
form with a subform/subreport. Now I want to write the information on
the tables to a text file accoding to their relationships. For example
The first Invoice from The parent table with all its items from the
child table and so on. I have been using this code to do that but I can
not access the subform values.

FileSpec = Path
lngFN = FreeFile()

Open FileSpec For Output As #lngFN
strLine = PODN & F & Item_No
Print #lngFN, strLine

Close #lngFN

How can I loop through both tables to write all the items to a text
file. I will really appreciate it if you can help me with the code.
 
J

John Nurick

Hi Themba,

The usual technique is to create a query that joins the two tables, and
then export the query using DoCmd.TransferText.
 

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