我打开了具有特定记录的表单,但是无法编辑数据

时间:2019-05-13 09:21:54

标签: vba ms-access

我用以下命令打开一个表单:

DoCmd.OpenForm strOpenForm, , , "project = '" & gr_nr & "'", datamode:=acFormEdit

表格将打开并显示数据。当我更改数据并尝试保存时,收到写冲突,记录被另一用户更改。 添加新记录时,添加该记录没有问题。

以其他形式打开的窗体中的函数:

Private Function KlantClick()
    Dim strVeld As String

    Select Case VBA.Environ("USERNAME")
    Case "Zaag1"
        strOpenForm = "Zaag1"
    Case "Zaag2"
        strOpenForm = "Zaag2"
    Case "anne.vanwesepoel"
        strOpenForm = "Zaag1"
    Case Else
        MsgBox "Schermen enkel toegankelijk voor de zaagmachines"
    End Select

    If Not IsNull(DLookup("project", "dbo_afwerk", "Project = '" & gr_nr & "'")) Then
       DoCmd.OpenForm strOpenForm, , , "project = '" & gr_nr & "' and volgnr = 1 and locatie = 'Zaag1'", datamode:=acFormEdit


    Else
        DoCmd.OpenForm strOpenForm, datamode:=acFormAdd
    End If

End Function

我需要能够更改表格的数据。

0 个答案:

没有答案