I seek a bit more help with a small piece of code.
I have data that is entered in a table tblStandardPhrase in this format AQTF1.1 AQTF1.2 and so on and is them used via the code below
It is important that the data is entered in this manner.
If the data is in this format AQTF11 the code below functions correctly.
CODE
For i = lStart To lEnd
If Me.Controls(sInitChar & "ChkTRC" & CStr(i)) = -1 Then 'Insert only if the value Yes CodeNonCon CI,
sSql = "INSERT INTO tblAuditNonConformance (ANCAuditID, ANCRTOID, ANCNonConTypeID, ANCAuditItem," & _
"ANCAuditNonConformance, ANCAuDitType, ANCObservation, ANCAuditSortSequence, ANCCorrectiveAction, ANCRecAuditDate) " & _
"SELECT " & txtIDInAud & " AS IDInAud, " & txtRTOID & " AS RTOID, " & txtNonConTypeID & " AS txtNonConTypeID," & _
"CodeName, Code, ColName, CodeObservation, AuditSortSequence, CodeNonCon, #" & Format(InAuditDate, "dd-mmm-yyyy") & "# " & _
"FROM tblStandardPhrase WHERE CodeName = 'AQTF" & CStr(i) & "'"
db.Execute sSql
End If
Next
If Me.Controls(sInitChar & "ChkTRC" & CStr(i)) = -1 Then 'Insert only if the value Yes CodeNonCon CI,
sSql = "INSERT INTO tblAuditNonConformance (ANCAuditID, ANCRTOID, ANCNonConTypeID, ANCAuditItem," & _
"ANCAuditNonConformance, ANCAuDitType, ANCObservation, ANCAuditSortSequence, ANCCorrectiveAction, ANCRecAuditDate) " & _
"SELECT " & txtIDInAud & " AS IDInAud, " & txtRTOID & " AS RTOID, " & txtNonConTypeID & " AS txtNonConTypeID," & _
"CodeName, Code, ColName, CodeObservation, AuditSortSequence, CodeNonCon, #" & Format(InAuditDate, "dd-mmm-yyyy") & "# " & _
"FROM tblStandardPhrase WHERE CodeName = 'AQTF" & CStr(i) & "'"
db.Execute sSql
End If
Next
However, in this format AQTF1.1 it does not get picked up. I think that it is here where it fall over.
CODE
"FROM tblStandardPhrase WHERE CodeName = 'AQTF" & CStr(i) & "'"
I am not sure how to get the code to look at the 1.1
Many thanks