Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: add records to a table with a commandbutton

0 views
Skip to first unread message

Brendan Reynolds

unread,
Aug 16, 2004, 11:13:23 AM8/16/04
to
Yes, but the details depend on where the values for those new records are
coming from. Here's an example that creates a single record using values
from text boxes on the same form as the command button.

Private Sub Command4_Click()

Dim strSQL As String

strSQL = "INSERT INTO tblTest (TestOne, TestTwo) VALUES ('" &
Me!Text0.Value & "', '" & Me!Text2.Value & "')"
CurrentProject.Connection.Execute strSQL

End Sub

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


"jan.nl" <ja...@discussions.microsoft.com> wrote in message
news:7C1F1075-EFBE-4E13...@microsoft.com...
> Hello,
> Is there a way to add new records to a table using a commandbutton located
> on a form? Warning: I am not good in writing code! Can anyone help me on
the
> way please?
> --
> thanks in advance,
> jan.nl


0 new messages