Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP!! APPEND QUERY NOT WORKING 1

Status
Not open for further replies.

justme1310

Technical User
Jul 23, 2003
16
TT
Hi Everyone,
Can someone please help me with this problem.
I'm trying to keep track of changes made to a certain field by saving relevant details as a record in the table tblchanges.

tblchanges has the following fields:-

ID : Autonumber
Fileno : Text
Fieldname : Text
Oldvalue : Text
NewValue : Text
Datechg : Date/Time

I verified that all the values are being passed to the SQL statement, yet the table is not being updated.

What am I doing wrong?? SEE CODE BELOW

Thanks in advance.


Will

Code:
Private Sub Combo36_Change()
Dim flno As String
Dim fldnme As String
Dim oldval As String
Dim newval As String
Dim tdate As Date

flno = PFILENO
fldnme = "ONCOLOGIST"
oldval = Text29
newval = Combo36
tdate = Date


strSql = "INSERT INTO tblchanges " _
     & "( fileno,fieldname, oldvalue, newvalue, datechg ) " _
     & "VALUES ( " & flno & ", " & fldnme & ", " & oldval & ", " & newval & ", " & tdate & " )"


DoCmd.RunSQL strSql

End Sub

 
& "VALUES ([!]'[/!]" & flno & "[!]'[/!],[!]'[/!]" & fldnme & "[!]'[/!],[!]'[/!]" & oldval & "[!]'[/!],[!]'[/!]" & newval & "[!]'[/!],[!]#[/!]" & tdate & "[!]#[/!])"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
THANK YOU PHV

Works wonderfully...


Thanks again


Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top