RE: Form Code to update the table

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks for the quick reply.

All these suggestions are helpful. But still that is not the solution I am
looking for.
As I do not want user to see how many and what records are there in the
table, but at the same time if they enter ResourceID (unique –PK) they should
be able to view the details for that ID. So its not about adding new data,
its about updating existing data and keeping track of the updates.
Data is already there in the table, user will be updating data and adding
comments to the table.
So here the picture of the form I am trying to design. (this is the simple
way I have not made fancy yet, once code and everything is set up, I will try
to look it fancy)
First – I have created the blank table ‘tblResources’ – data entry coming
from ‘frmResources’ will be stored in this table.
User will have access to ‘frmResources’. So when they enter ID the related
fields details will pop up – comments, date, ..etc.
At the bottom of the form I have created two buttons – update and Exit.
So if user needs to update the information ( for eg. Update the comments)
they will change in the form and then when they click on update – it should
save the update into the table and whey they click on Exit – the
form(application) will just quit without saving the change.

Sorry for making it complicated but this is what I am trying to design it.
appreciate your help.
Thanks


"Jack Leach" wrote:

set the DataEntry property of the form to True... this lets them add new
records only and not view any existing ones.

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)



"kay" wrote:

Thanks,
I tried this way but what happens that first time when the table was blank
it worked fine. when you enter data in forms it goes to table but next time
when you open the form it shows previous entries and that i do not want to
show to user.
they should not know what is there in the table.

hope i am able to explain my point.

"kismert" wrote:

You are working too hard. You want a "bound form" to do the work for you.

You do this by binding the form to the table via a query:
1. Make a query, qryResources, which returns all the fields in table
Resources, (Why? call it good practice)
2. In your form, set the Recordsource property to qryResources.
3. For each control in the form, set the Control Source to the appropriate
field in the query.

There! You now have a basic form that will read and write data to a table.

Of course, there is a lot more twiddling you will want to do with the form
properties to get something close to what you want, but I leave you with your
perseverance and the trusty F1 key.

-Ken


.



Relevant Pages

  • RE: Form Code to update the table
    ... way I have not made fancy yet, once code and everything is set up, I will try ... At the bottom of the form I have created two buttons – update and Exit. ... "Jack Leach" wrote: ... Make a query, qryResources, which returns all the fields in table ...
    (microsoft.public.access.formscoding)
  • RE: Breaking down imported information
    ... Single-record append query: ... ' Check if at EOF of Recordset (rsDataViaCode) ... ' if at EOF Exit Do. ... Dim rsDataViaCode As DAO.Recordset ...
    (microsoft.public.access.modulesdaovba)
  • RE: Need to set Filters on a form based on several drop down boxes
    ... can you see something wrong with the SQL statement? ... Private Sub psBuildSQL() ... "Jack Leach" wrote: ... know that saved queries will always run faster than a "built" query. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Need to set Filters on a form based on several drop down boxes
    ... know that saved queries will always run faster than a "built" query. ... "Jack Leach" wrote: ... Assuming you're on a mainform with and want to filter a subform (I do this ... Private Sub Combo0_AfterUpdate ...
    (microsoft.public.access.modulesdaovba)
  • how to access variables from a previous page
    ... before the queries, there is an if/else,if the user pushes an Excel ... If a user is a customer there is one query. ...
    (comp.lang.php)