FILL IN FORM DATA USING .TXT FILE

G

Guest

Hi,
I'm basically aiming to be able to save a form in it's current state, so
that when you re-open, the values in the form's unbound textboxes are the
same as before you closed them. I want to do this without linking them to a
table.
So I've made a button to docmd.outputto, which functions as a save button.
Now I need to get that data back into the form from the .txt file or 'Save'.
Thanks
 
J

John W. Vinson

Hi,
I'm basically aiming to be able to save a form in it's current state, so
that when you re-open, the values in the form's unbound textboxes are the
same as before you closed them. I want to do this without linking them to a
table.
So I've made a button to docmd.outputto, which functions as a save button.
Now I need to get that data back into the form from the .txt file or 'Save'.
Thanks

That doesn't seem to make much sense! A Form in Access is just a window, a
tool to manage data in tables. You ARE storing the data in a "table" of sorts
- an external text file. Why not use a table, perhaps just a single-record
table that you overwrite as needed?

John W. Vinson [MVP]
 
L

Larry Linson

s4 said:
Hi,
I'm basically aiming to be able to save a form in it's current state, so
that when you re-open, the values in the form's unbound textboxes are the
same as before you closed them. I want to do this without linking them to
a
table.
So I've made a button to docmd.outputto, which functions as a save button.
Now I need to get that data back into the form from the .txt file or
'Save'.

I agree with John that a single-record table would simplify your
implementation. But Access does have FILE I/O statements, many of them
unchanged since the days of QuickBasic. You can use those to read a text
file and set the data from records in the file, and to write it when you
close the form. But, it'll be a LOT easier if you just create a
single-record table.

If you need that table to be unique to each user, you can define it in the
front-end database that you distribute to each user, or create a temporary
table in a temporary database (easy by putting the definition in your DB,
using CreateDatabase, and exporting the table structure with CopyObject) on
the machine where Access is executing.

Larry Linson
Microsoft Access MVP
 
L

Larry Daugherty

Larry,

Those File I/O thingies are actually unchanged from the earliest
implementations of BASIC! QuickBasic and other pretenders came later
:)

HTH
 
G

Guest

Thanks.
The reason I don't have a table is basically that I'm using the form to
input data that is then printed onto a report, rather than storing records.
Thanks for your help though, maybe I will use a single record table, it will
be easier!
Thanks
 

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