Re: Insert New Record



"tiredoftrying" <tiredoftrying@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:CD71B565-37E0-44D1-9992-03C925791C68@xxxxxxxxxxxxx
> very helpful - but one more question, using the code you provided
> what if I wanted to use fields on my form that has the values in them
> to populate the new record

Assuming both fields are numeric, as you said:

CurrentDb.Execute _
"INSERT INTO POINTS (NAME_ID, SCORE) " & _
"VALUES(" & Me!txtNameID & ", " & Me!txtScore & ")", _
dbFailOnError

where "txtNameID" and "txtScore" are the names of the controls on your
form.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.



Relevant Pages