Input Output Append and stuff

A real begineer

Registered User.
Local time
Today, 16:57
Joined
Nov 4, 2000
Messages
74
I have been playing with the idea of outputting to a file for tempoary storage some data using the input output append methods. However, when I search help on these topics my help loops into a crash. I am using Access 2000.

So far I have written the following code which certainly creates the datafile, although I can't work out the reciprocal statement to input the data back into another textbox on the form.

Here is what I have done:

Private Sub chkA_Click()
Dim varA As Variant
Dim strChk As String

varA = txtM

strChk = MsgBox("I am txtM " & varA)

Dim TextLine
Open "C:\Dynamic\TESTFILE" For Append As #1 ' Open file.
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, varA ' Read line into variable.
Loop
Close #1 ' Close file.

Call chkB

End Sub

chkB is another function which is supposed to read file TESTFILE and then output the varA to a textbox on the same form.

So far all I have generated is errors. My help file refers to an output function. Yet if I type a copy of my first line of code with output in place of input it accepts this, but does not accept:

Line Output #1,varA

So how does this work?
 
Create a temporary table ("tlocTableName") to save your data.

Be sure to empty the temporary table after each use so that the next time you repair/compact your mdb you won't have the bloat of the temporary table.
 
The underlying thought behind this is to retain records for twelve months. For some retail customers, but not all. I thought it would be nice to have the option of using DAT files as they are smaller and if I create a few hundred, won't cause any problems with Access.
 
I would go for tables still, if storage space or clutter is really going to be a problem, you could store them in a separate database.

You potentially lose a lot of the 'subtlety' of your table structures if you export as plain text, that's my reasoning.

Mike
 

Users who are viewing this thread

Back
Top Bottom