Leif Eriksen said:
[I wrote:]
I can't quite make sense of that. What do you mean?
Because the print field has been changed (from unmarked
to marked), and the print field is part of the larger
table, that record is locked until the user navigates to
another record or clicks the command button to execute
the print.
Yes, that would be true. You could, of course, force an immediate save
in the check box's AfterUpdate event. But that doesn't solve the larger
problem.
My GUI is showing the records as a datasheet. The
easiest way for the user to work is to have a check box,
to the left of the datasheet row, that indicates the user
whats that row reported.
Suit yourself.
I do not use a back end / front end. I've tried it, and
its too slow. Even using some of the tricks like
maintaining a constant connection, I found its too slow.
I really don't see why the FE/BE setup would be slower than having
multiple users working in the same monolithic database file. There is
simply no reason for it to be any slower. The same data has to go
across the network to each user, and the same locking has to occur.
Furthermore, with the monolithic arrangement, all the design information
for forms, reports, and queries has to go across the network, too -- and
incidentally leads to a higher incidence of corruption.
I strongly urge you to revisit this question, and try to figure out why
your FE/BE arrangement is too slow. Maintaining the constant connection
to the back-end reliably fixes the only performance issue I know of with
this arrangement. Have you by any chance seen Tony Toews' Access
Performance FAQ page:
http://www.granite.ab.ca/access/performancefaq.htm ?
However, regardless of whether I did it local or on the
file server I still need to maintain this table (i.e.,
delete records when the user exits or changes units. If
I did that on the server I would need to add a user id to
the table.
Which is why I say this table should be on the local workstation. If
you have a FE/BE arrangement, you can put the table in the front-end
with very little bother. Clean-up code triggered by some suitable event
can empty the table by running a delete query.
If you insist on using a monolithic database, you can still use a local
table, by creating a temporary database file to hold this table. You
could create this database (in the current user's Temp folder), and
create the table in the database, in your startup code, and delete the
database in code that runs when the database is closed. Creating a
temporary "work" database is not difficult at all -- I have a simple
class that takes care of it for me, when I need to do it. Let me know
if you're interested. It could get complicated in this case, because
you must avoid creating a linked tabledef in the (monolithic) database,
but you could dynamically set the recordsource of your form to a SQL
statement that uses the IN clause to identify the work database that is
the source for the SelectedRecords table.
Is there a way to keep the data in variables, or create a
record set that is not based on a table? Can I write the
information to a in memory structure? Oracle, using
PL/SQL allows a user to do this using table and record
types, which can be based on the structure (fields) of a
table. Does something like that exist in Access/VBA?
Even if I could, can I then display the information in a
datasheet/form?
You *may* be able to create a disconnected ADO recordset and bind a form
to it, but I *think* such a recordset will be read-only. I could be
wrong about that. Aside from that, I can't think of any way you can
bind a form to a structure that exists only in memory, with no
underlying physical storage.
No, wait. I can imagine a global Collection of primary keys, and a
query with a calculated field that calls a function that returns True if
the current record's key is in the collection, false if not. The check
box on your form would be bound to this calculated field. Then code in
the Click event of the check box would add the record's key to the
collection, or remove it from the collection, depending on the current
state of the check box, and after doing that would refresh the record.
That might work. It seems rather fragile to me, though.