Recordsets are for manipulating data programmatically. They don't have an
interface (like a form or datasheet.) So, if the user needs to select stuff
and enter values, you need a form, but if you want the computer to make the
changes (or count, or automatically add or delete), you can use a recordset.
The basic idea is to create a SQL statement that gives you the fields and
records you need. You can then operate on them. Here's a basic example of
opening a recordset and programmatically looping through the records:
http://allenbrowne.com/func-DAO.html...cordsetExample
When you open a form, Access does create a recordset behind the scenes that
it uses to serve up the records. You can get at those records via the
RecordsetClone of the form. In a typically example, you can search the clone
set to see if a particular record is there, display it if it is (by setting
the form's Bookmark) or give a message if it's not there. Here's an example
of doing that:
http://allenbrowne.com/ser-03.html
You can perform an 'opereration' on the records by looping through them and
using Edit (or AddNew) and Update, or using Delete. There are cases where
that's a good approach, but if it is a simple operation, you will probably
find it easier to execute an action query instead. Here's some info on how
to do that:
http://allenbrowne.com/ser-60.html
Once you have the basics of recordsets figured out, here's a list of the 10
most common mistakes I see people making when working with recordsets:
http://allenbrowne.com/ser-29.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Nicola M" <(E-Mail Removed)> wrote in message
news

5A5D3F3-286A-4237-9C4D-(E-Mail Removed)...
> Hi all! Access 2003
>
> I'm pretty newbie on Access VBA. I use just some well known functions
> (format, Ucase, LCase, Trim etc) and some little user defined function
> written by myself.
> Now I'd like to manage data returned by queries or by entire tables. I
> read
> something about on Help, forums and tutorials and I'm here to ask some
> explanation. Please note I'm already able to show set of data using forms
> and/or reports.
> If I need to select several records (even not in succession) to do some
> "operation" on them I understand I should use the recorset that is a
> perfect
> replica of the set of data I have in front of me...
> Is it correct? how can I manage recordsets? I'd like to understand this
> because I think it is the base to work on data programatically...
> Other needs I have could be:
> - starting from a data set in a form update all of them (or only someone)
> with an update query built at the moment;
> - starting from a data set in a form insert some data (usually the ID of
> some records) in another table; also i need to rollback the operation;
> ...
> Now I do this things using queries but I'd like to provide "buttons" or
> "checkboxes" to my users because they are not familiar with SQL.
>
> Sorry for my English and for the long message.
>
> Thank you in advance for any suggestion or advice.
> Nicola M