accessguy52
Programmer
Can anyone tell me why one of my tables gets it's flds updated but the other one doesn't? This is a real mystery! I can't see why something that worked for one table won't work for the other. Same commands, different table. Here's the code. If you can figure THIS one out, you have my utmost respect! Thanks.
*************************************
Dim rs As Recordset
Dim rst As Recordset
Dim rst3 As Recordset
Dim db As Database
Set db = CurrentDb
Set rst = db.OpenRecordset("tblRisk_Severity_Levels")
Set rs = db.OpenRecordset("tblProject2")
Set rst3 = db.OpenRecordset("tblRiskInput")
Dim strSQL As String
Dim strSQL2 As String
Dim strSQL3 As String
Dim strSQL4 As String
Dim strSQL5 As String
Dim strSQL6 As String
Dim str1, str2, str3 As String
str1 = Me!Title
str2 = Me!FP_ID
str3 = Me!PM_Name
strSQL = "UPDATE TBLRISK_SEVERITY_LEVELS SET PROJECT_NAME = " & "'" & str1 & "'" & ";"
strSQL2 = "UPDATE TBLRISK_SEVERITY_LEVELS SET PROJECT_NUMBER = " & str2 & ";"
strSQL3 = "UPDATE TBLRISK_SEVERITY_lEVELS SET PROJECT_MGR = " & "'" & str3 & "'" & ";"
'Now put the same info into the Risk Input screen...
strSQL4 = "UPDATE tblRiskInput SET PROJECT_NAME = " & "'" & str1 & "'" & ";"
strSQL5 = "UPDATE tblRiskInput SET FPID = " & str2 & ";"
strSQL6 = "UPDATE tblRiskInput SET PM_NAME = " & "'" & str3 & "'" & ";"
db.Execute strSQL
db.Execute strSQL2
db.Execute strSQL3
db.Execute strSQL4
db.Execute strSQL5
db.Execute strSQL6
rst3.Close
rs.Close
rst.Close
MsgBox "Updating Risk Input", vbOKOnly
MsgBox "Updating Questionnaire", vbOKOnly
accessguy52
*************************************
Dim rs As Recordset
Dim rst As Recordset
Dim rst3 As Recordset
Dim db As Database
Set db = CurrentDb
Set rst = db.OpenRecordset("tblRisk_Severity_Levels")
Set rs = db.OpenRecordset("tblProject2")
Set rst3 = db.OpenRecordset("tblRiskInput")
Dim strSQL As String
Dim strSQL2 As String
Dim strSQL3 As String
Dim strSQL4 As String
Dim strSQL5 As String
Dim strSQL6 As String
Dim str1, str2, str3 As String
str1 = Me!Title
str2 = Me!FP_ID
str3 = Me!PM_Name
strSQL = "UPDATE TBLRISK_SEVERITY_LEVELS SET PROJECT_NAME = " & "'" & str1 & "'" & ";"
strSQL2 = "UPDATE TBLRISK_SEVERITY_LEVELS SET PROJECT_NUMBER = " & str2 & ";"
strSQL3 = "UPDATE TBLRISK_SEVERITY_lEVELS SET PROJECT_MGR = " & "'" & str3 & "'" & ";"
'Now put the same info into the Risk Input screen...
strSQL4 = "UPDATE tblRiskInput SET PROJECT_NAME = " & "'" & str1 & "'" & ";"
strSQL5 = "UPDATE tblRiskInput SET FPID = " & str2 & ";"
strSQL6 = "UPDATE tblRiskInput SET PM_NAME = " & "'" & str3 & "'" & ";"
db.Execute strSQL
db.Execute strSQL2
db.Execute strSQL3
db.Execute strSQL4
db.Execute strSQL5
db.Execute strSQL6
rst3.Close
rs.Close
rst.Close
MsgBox "Updating Risk Input", vbOKOnly
MsgBox "Updating Questionnaire", vbOKOnly
accessguy52