'============================================================
' Добавление_одной_записи в таблицу
'strAdd - строка для добавления
'oTbl - таблица для добавления
'strFldAddName - имя поля для добавления
'strFldCondition - имя поля условий
'strCondition - условие
'Fn_ = FnAddRecordInTbl(strAdd, oTbl, "PathBase", "NickBase", "ListPoint")
'DoCmd.RunSQL "UPDATE SystemLastSelectedPath SET SystemLastSelectedPath.PathBase = ""gкупкруеруеркр"" _
WHERE (((SystemLastSelectedPath.NickBase)=""ListPoint""));", -1
'------------------------------------------------------------
Function FnAddRecordInTbl(ByVal strAdd As Variant, _
ByVal oTbl As Object, _
ByVal strFldAddName As String, _
ByVal strFldCondition As String, _
ByVal strCondition As String) As Boolean
Dim strTblName As String: strTblName = oTbl.Name
Dim strSql As String
On Error GoTo FnAddRecordInTbl_Err
strSql = "UPDATE " & strTblName & " SET " & strTblName & "." & strFldAddName & " = """ & strAdd & _
""" WHERE (((" & strTblName & "." & strFldCondition & ")=""" & strCondition & """));"
DoCmd.RunSQL strSql, -1
FnAddRecordInTbl_Exit:
FnAddRecordInTbl = True
Exit Function
FnAddRecordInTbl_Err:
FnAddRecordInTbl = False
' MsgBox Error$
' Resume FnAddRecordInTbl_Exit
End Function
'============================================================