AA,
Your SQL string is incomplete; you are specifying which table/fields to
append to, but not the values to append! You need to change it to
something like:
Private Sub Update_Contact_Click()
Dim QrySQL As String
QrySQL = "INSERT INTO [Contacts] ( Company, Street, Floor, " & _
CityStateZip, Telephone, Fax, Manager, Email) " & _
"SELECT '" & Me!TbxComp & "' AS Expr1, '" & _
Me!TbxStreet & "' AS Expr2, " & _
Me!TbxFloor & " AS Expr3, '" & _
Me!TbxCityStateZip & " AS Expr4, '" & _
Me!Telephone & " AS Expr5, '" & _
Me!TbxFax & " AS Expr6, '" & _
Me!TbxAcctMgr& " AS Expr7, '" & _
Me!TbxEmail & " AS Expr8"
DoCmd.SetWarnings False
DoCmd.RunSQL QrySQL
DoCmd.SetWarnings True
MsgBox "Update Was Completed"
End Sub
In the above I have assumed that all fields are text except Floor, which
I assumed to be numeric. Note how all other control references (except
Me!TbxFloor) are enclosed in single quotes, to denote text. Make any
changes required, if different field types than what I have assumed.
Also, there is a lot of unused stuff in your form module, which probably
just confuses you. Wherever there is a:
Private Sub xxxxxxxxxxxxxxxxx
End Sub
with no code in between, you can just delete it (if in doubt, make a
backup copy first!).
HTH,
Nikos
> Hello All,
>
[quoted text clipped - 88 lines]
> AA
> -----------------------------------------
AA - 17 Mar 2005 17:19 GMT
thank you Nikos
let me play with your code
AA
> AA,
>
[quoted text clipped - 132 lines]
> > AA
> > -----------------------------------------