Manipulating data using data in tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Newbie with Access.

Assuming I have a table with Name, age, tel, salary and qty as the fields.

I need to create forms that can, display the data, add new records, delete
records and update records.

Assuming I need to update the records, how do I go abt doing it using VBA??
How do I go abt to reference the data like referencing cells in Excel VBA??

Thanx for the help in advance.
 
Swish,

If you are talking about updating records, as in find a record where the
data has changed and needs editing, then you don't need nay VBA to do
this, you just edit the data right there on the form. If, on the other
hand, you mean updating multiple records at once, based on some sort of
blanket process, then you would probably be best to run an Update Query.
Access doesn't have cells. In VBA you reference controls on a form by
the name of the control.

Hope these comments are useful. If you need more explicit help, maybe
you could post back with some more details, including examples of what
you would like to do, and someone may be able to make suggestions.
 
Hi Steve,

I understand that you can actually modify the data in the table using forms.
But the problem is that if you have many records, you will have to scroll
through the records 1 by 1 to the record you want.

Thus my idea is to let user enters all the necessary info and let VBA runs
on its own.

Or is there anyway to let the form shows the record you want??

Thanx for the help.
 
Swish,

There are a number of ways to get a form to show "the record you want".

One is to have a combobox on a form where you select the name/ID of the
record you want, and then use a "where condition" argument of the
OpenForm method in your code to open the form at the selected record.
An associated approach is to use a query as the Record Source for the
form, and reference the combobox on the form in the criteria of the
query, so once again the form shows the selected record. Another
approach is to use the FindRecord method, which also is very effective.
And there are others. The choice would partly depend on the specifics
of the data and the form and what you wanted to do, so this is why I
suggested before to give some data examples.
 
Back
Top