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
Are Mac's easier to support than PC's? Why or why not?
Multicast session fails to open on secondary site server.
troubleshoot slow macbook pro pinwheel
How to raise 2 GB mailbox limit in Exchange 2007?
how to find my Symantec pcAnywhere serial number
How do I convert string to char?
Standard server 2008 to SBS premium 2008
Microsoft SQL Server Reporting Services send E-mail in plain text
Access user control function from master page
Am I elegible for a free upgrade to Outlook 2010 with this?