INSERT into table function

T

Tom

The following function is intended to allow changes in
values (date & location) and then stores old
date/location "History" table.

So, potentially, I will have 10 dates and location in the
History table:

Current problem:
- Line "CurrentDB..." gets highlighted after changing
data. History table is not updated.

Does anybody know what need to be changed. BTW, the date
format can be simply "MM/DD/YYYY".

Thanks in advance,
Tom


&&&&&&&&&&&&&&&&&&&&&&

Private Sub Location_AfterUpdate()

strSQL = "INSERT INTO History" & _
"VALUES ( " & _
Format$(Now(), "\#yyyy\-mm\-dd hh\:nn\#")
& ", " & _
"""" & Me!Location.Value & """)"


MsgBox strSQL, , "Check this out!"

CurrentDb().Execute strSQL, dbFailOnError

End Sub
 
T

Tom

Douglas:

Thanks for the prompt feedback...

I inserted your modified version of the function. The
error dialog box comes up as an "Syntax error in INSERT
function" (error number 3134).

BTW, currently I have only those 2 fields (date &
locataion). More than likely though, I will need to
include the AUTONUMBER id of the field that is designated
primary key.

Do you have any pointers as to how I need to modify the
INSERT statement?

Thanks,
Tom
 
T

Tom

Tim:

I apologize for having started a new thread. I had to
meet a deadline... I did check the original thread a few
times to find additional support.

I finally got this working today.

Again, thanks for your continous support on this!!!

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top