我创建了两种形式。按下按钮1将打开表格编号2。通过关闭表格编号2,将显示表格编号1。但是此操作仅执行一次,它第二次停止,几乎不起作用。代码在哪里有问题?
代码Userform1:
Private Sub ShowUserform2_Click()
UserForm1.Hide
Unload UserForm1
UserForm2.Show
End Sub
代码userform2:
Private Sub UserForm_Terminate()
UserForm2.Hide
Unload UserForm2
UserForm1.Show
End Sub
答案 0 :(得分:0)
跳过PagingProvider<Employee> provider = new PagingProvider<Employee>(context.Employees);
provider.FilterExp = (employee, filterText) => employee.FullName.Contains(filterText);
return provider.GetResults();
行。它们是不必要的。
在formName.Hide
语句之后添加:
Unload formName
另外,将Set formName = Nothing
行置于上述两行之前。
答案 1 :(得分:0)
尝试以下代码:
代码Userform1:
Private Sub ShowUserform2_Click()
UserForm1.Hide
UserForm2.Show
End Sub
代码userform2:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
UserForm1.Show
End Sub