Saving new records to a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use a form to save entries to table.

The statement I used were as follows.

INSERT INTO Factrial
SELECT ENTITY_IDENTIFIER AS ENTITY_IDENTIFIER
FROM Form1;

I have a command button on the form which when clicked runs the query.
However the error message reads "can't find table or query named 'Form1 ".
How do I deal with this ? how can I make my query take input from a form and
store it in a table ? Appreciate your help.
 
The FROM clause in a query must identify a table or query, not a form. Try
something like this instead.

Dim v_Entity_Identifier As Long
Dim v_Sql As String

v_Entity_Identifier = Me.Entity_Identifier
v_Sql = "Insert Into Factrial Values ("
v_Sql = v_Sql & v_Entity_Identifier
v_Sql = v_Sql & ");"
DoCmd.RunSql v_Sql

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html
 
Back
Top