Logging Problem

  • Thread starter Thread starter John Daily
  • Start date Start date
J

John Daily

I am having a problem with a form that displays the
current users name on it in a text box. There is another
text box with the current date and time.
I have these linked to a table but can't figure out how to
pass the information to the table once the user clicks on
the agree button or when they open the database (either
one is fine). I need it to track usage and I can't get it
to work. I think it is probably something simple I am
overlooking.

Please help!

TIA,

John
 
when the form closes:

docomd.runsql("INSERT INTO tablename VALUES( "" &
nametextbox & "", "" & datetextbox & "")")

I think I got the ""s right. I usually create a function
to make reading it easier

public function AddQuotes(strString as string) as string
Addquotes= vbchr(34) & strstring & vbchr(34)
end function

If you use that:
docmd.runsql("INSERT INTO tablename VALUES(" & addquotes
(nametextbox) & ", " & addquotes(datetextbox) ")")

HTH

mw
 
Back
Top