Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ms access 每次尝试打开Visual Basic时,MS Access都会崩溃_Ms Access_Vba_Ms Access 2013 - Fatal编程技术网

Ms access 每次尝试打开Visual Basic时,MS Access都会崩溃

Ms access 每次尝试打开Visual Basic时,MS Access都会崩溃,ms-access,vba,ms-access-2013,Ms Access,Vba,Ms Access 2013,所以我有一个分裂的数据库 dbBackEnd: Lives on the network drive, users don't touch it except through the front ends. dbFrontEndv1:Stored by me for safekeeping, works fine dbFrontEndv2:Stored by me for safekeeping, works fine dbFrontEndv3:Users are interacting wit

所以我有一个分裂的数据库

dbBackEnd: Lives on the network drive, users don't touch it except through the front ends.
dbFrontEndv1:Stored by me for safekeeping, works fine
dbFrontEndv2:Stored by me for safekeeping, works fine
dbFrontEndv3:Users are interacting with this now, works fine
dbFrontEndv4: Freezes every time I try to do something in VBA
我已经玩了半打的游戏就是这样

(1) 将dbFrontEndv3复制到新文件夹并将其重命名为dbFrontEndv4

(2) 打开dbFrontEndv4并打开Form1。如果我现在保存并重新输入,它可以正常工作

(3) 添加1或2个命令按钮。触发宏的命令按钮工作正常。 VBA是在这里引起麻烦的

(4) 编译,没有错误

(4) 保存并退出

(5) 打开dbFrontEndv4,单击表单或任何与VBA相关的内容

(6) 错误:“Microsoft Access没有响应…”,“Access正在重新启动

在添加和减去sub、保存、关闭和重新打开之后,这似乎是令人不快的一个

Private Sub cmdMCF_Click()
Dim appExcel As Excel.Application
Dim wbook As Excel.Workbook
Dim wsheet As Excel.Worksheet

Set appExcel = New Excel.Application
appExcel.Visible = True
Set wbook = appExcel.Workbooks.Open("C:\Path\MyDoc.xlsx")
Set wsheet = wbook.Worksheets("MCF")

With wsheet
    .Cells(10, 1).Value = txtCustomerName
    .Cells(10, 2).Value = txtCustomerNumber
    .Cells(10, 3).Value = txtAddress + " " + txtCity + " " + txtState + " " + txtzip

    .Cells(12, 1).Value = txtPhone
    .Cells(12, 2).Value = txtEmail
    .Cells(12, 3).Value = txtmeasurenumber

    .Cells(14, 1).Value = txtStore
    .Cells(14, 2).Value = txtAssignedIP

End With

End Sub
如果它只是停留在代码中就可以了。但是当我给一个按钮命名为cmdMCF时,错误就开始了

问题是这个子组件“复制和过去”现在正在dbFrontEndv3上使用。在实现dbFrontEndv3时,我曾经遇到过同样的错误,但它工作得很好


上面代码中的哪些内容可能会导致这些随机崩溃?

我遇到过类似的问题,在access的一个版本中创建了一个表单,然后在另一个版本中编辑。虽然文件应该在不同版本之间兼容,但也存在一些差异


尝试在您使用的版本中从头开始重新创建表单。

编译会保存一个损坏的前端吗,还是我必须从一个工作的db开始?它实际上是反编译,但绝对值得一试。在开发过程中,当这种情况发生时,我会定期反编译/重新编译我的项目。