Microsoft
Software
Hardware
Network
Question : Updating a table using SQL and variables
I need to update tblPAA with variables defined in the sub procedure.
DoCmd.RunSQL "INSERT INTO tblPPA (intPPAID, intIncidentID, txtPPAEffectiveDate, txtPPAPeriod, datPPAExpiryDate, txtFirstName, txtMiddleName, txtLastName, txtAddress, txtCity, txtStateProv, txtPostalZip, txtDOB, txtDatedDate, txtInvestigator, intViolationSelfExclusion)
SELECT (strPPANum, intIncidentID, datPPAEffectiveDate, strPPAPeriod, datPPAExpiryDate, strFirstName, strMiddleName, strLastName, txtAddress, txtCity, txtStateProv, txtPostalZip, datDOB, datDate, strInvestigator, strViolationSE);"
When I run this line of code I get: "syntax error (comma) in query expression"
Answer : Updating a table using SQL and variables
try this
DoCmd.RunSQL "INSERT INTO tblPPA (intPPAID, intIncidentID, txtPPAEffectiveDate, txtPPAPeriod, datPPAExpiryDate, txtFirstName, txtMiddleName, txtLastName, txtAddress, txtCity, txtStateProv, txtPostalZip, txtDOB, txtDatedDate, txtInvestigator, intViolationSelfExclusion)
Values ('" & strPPANum & "',"& intIncidentID &", #"& datPPAEffectiveDate &"#,'" & strPPAPeriod & "', #"& datPPAExpiryDate &"#, '" & strFirstName & "', '" & strMiddleName & "', '" & strLastName & "', '" & txtAddress & "', '" & txtCity & "', '" & txtStateProv & "', '" & txtPostalZip & "', #"& datDOB &"#, #"& datDate &"#, '" & strInvestigator & "', '" & strViolationSE & "');"
Random Solutions
Problem with file name comparison in unix script
mouseleave event on panel, vb.net winforms
Install issue: XenApp 5 Feature Pack 3 on W2K8x64
Public Desktop Icons not showing in RDP sessions
Change primary smtp addresses for 29 users using powershell for exchange
Best AV for 2008 R2 64bit
Difference between Icefaces,myfaces,richfaces
in JSF?
phpmailer problem after migrating from Windows WAMP to Ubuntu LAMP
Outlook 2010 NK2 file
how can i create window service in C# using InstallUtil.exe ??