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

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)

------------------------------------------------------------------------------
Big thanks in advance , experts !

-- 
Allen Phailat Wongakanit
0
Utf
1/11/2008 5:16:21 AM
access.forms 6864 articles. 2 followers. Follow

3 Replies
667 Views

Similar Articles

[PageSpeed] 28

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....


-- 
Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com


0
Albert
1/11/2008 5:27:32 AM
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 ! 

-- 
Allen Phailat Wongakanit


"Albert D. Kallal" wrote:

> 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....
> 
> 
> -- 
> Albert D. Kallal    (Access MVP)
> Edmonton, Alberta Canada
> pleaseNOOSpamKallal@msn.com
> 
> 
> 
0
Utf
1/11/2008 5:37:53 AM
On Thu, 10 Jan 2008 21:37:53 -0800, ali <ali@discussions.microsoft.com> wrote:

>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]
0
John
1/11/2008 6:56:02 AM
Reply:

Similar Artilces:

Insert "name" and "auto ID" into tables by using a form
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) ------------------------------------------------------------------------------ Big thanks in advance , experts ! -- Allen Phailat Wongakanit Actually, you don't need any code at a...