If you actually have a table named "database" and a field named "user", you
need to change those names. I'm almost positive those are both reserved
words. Even if they're not in the list, I still wouldn't be comfortable
using them. You should adopt a naming convention. Myself, I prefix all
table names with "tbl" and all field names with "fld". This keeps any
strange errors from happening.
As for the syntax error, the first line you have looks correct, assuming the
value of txtuser is a number. If not, try the second one, with a minor
modification (remove the quote before the last parenthese):
DoCmd.RunSQL "INSERT INTO tblDatabase (fldUser) VALUES (' " & Me.txtuser & "
')"
hth
--
Jack Leach
www.tristatemachine.com
"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)