recordsetclone question

K

Karen

if i use the following as the code on the afterupdate event of an
unbound control on my form, does the user make changes in the 'real'
data or the clone?

With Me.RecordsetClone
.FindFirst "Reference=" & Me.Text863
If Not .NoMatch Then
Me.Bookmark = .Bookmark
Else
MsgBox "No Incident Found"
End If
End With


the form has a query as its record source and i just want to find a
record based on the incident number entered in text863 and then allow
the user to edit the data.

Thanks for your help.

Karen
 
G

Guest

Karen:

The data in the rows of the tables refernced in the query to which the form
is bound is changed when the user edits the form and saves the changes by
moving to another record, closing the form or otherwise explicitly saving the
record. The RecordsetClone is not a table or query in itself; it returns a
reference to the form's underlying recordset, i.e. the set of rows returned
by the query in your case, and in this case is merely a mechanism for moving
to a particular record.

Think of tables as unordered buckets of data. Tables have rows and columns
rather than records and fields, although the latter terms are commonly used.
Records and fields are actually relics of the terms used in old style file
systems where data was stored sequentially in fields in records and could be
accessed by physical position, unlike in a table.

A recordset is an object which provides a means of accessing the buckets of
data in an orderly manner, and through which the data in the buckets can be
viewed or updated. This is why we can use methods like MoveNext, MoveLast
etc with a recordset, which are meaningless in terms of a table, which has no
order so terms like next and last are meaningless. A form is the visual
layer on top of the recordset and provides a structured window into the
recordset.

In a relational database all data are stored as values at column positions
in rows in base tables, i.e. 'real' tables rather than the 'virtual' result
tables of a query. If a query is updateable, however, as is the case here,
changing the values in the query's result table changes the values in the
base tables from which it is derived.

While a fundamental principle of the database relational model is that all
data must be stored as values at column positions in rows in tables and in no
other way, this is sometimes not the case in practice and it may be found
that data are stored as values of a value list as the RowSource of a combo
box for instance, or even hard-coded in VBA functions or procedures. This
is a sign of a poorly designed application, however

Ken Sheridan
Stafford, England
 
K

Karen

Thanks for the extended lesson in recordsets. I was almost sure I was
doing the right thing but had to ask.
Thank you very much for your time answering my question. This forum
has been a wealth of information and I am happy to have found people to
whom I can turn in my times of need (which are rather frequent).

Karen
 

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

Similar Threads


Top