Insert "name" and "auto ID" into tables by using a form

A

ali

I have a table:
ID Name Nationality
101 Allen Taiwan
102 Sarah USA
103 Steve Japan



------------------------------------------------------------------------------

I'd like to create a form with the following objects

-- 2 textboxes (putting name and Nationality)

-- a button (when i press it, it will insert values in the 2 textboxes into
my database)
 
A

Albert D. Kallal

Actually, you don't need any code at all to do this.....

The instant the user tab's out of the last contorl...it will be updated..

If for some strange reason you DO need users to hit a button, and you want
to write code to send the data to the table, you can place beind the buttion
the following code on a form:


if me.dirty = True then
me.Dirty = false
end if

The above code will actually write the data from the form to the table....
 
A

ali

Albert, thanks for the knowledge.

Let me ask this way then!;

OK, now i have a form (as you said, the button is not needed). I'd like to
update my Database with my form, waht can i do, where do i go and what are
the setting that i should do?

Please help me , thanks a lot !
 
J

John W. Vinson

OK, now i have a form (as you said, the button is not needed). I'd like to
update my Database with my form, waht can i do, where do i go and what are
the setting that i should do?

An Access form is DESIGNED to update the database.

Type the data.
Close the form.

The database is updated without you doing *anything* else.

Or, Type the data.
Move to a new, or different, record.
The database is now updated without you doing *anything* else.

Don't make an easy job into a hard one!

John W. Vinson [MVP]
 

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

Top