【问题标题】:reference subform of subform from 4th form第 4 表格的子表格的参考子表格
【发布时间】:2015-06-02 04:10:22
【问题描述】:

我已经尝试了许多不同站点的每个建议,但没有一个有效,甚至 Microsoft 的知识库文章或 Stack Overflow 中建议的参考资料也不行。

我有一个主表单 [frmMain],一个名为 [frmTaskTracking] 的子表单和一个名为 [sfmActivites 子表单] 的子表单。我需要从 [frmTaskTracking] 打开的弹出表单 [frmExportTasks] 中获取 [sfmActivites 子表单] 的过滤器:

[frmMain]
  [frmTaskTracking]
    [sfmActivites subform]
      Filter
[frmExportTasks]

在 VBA 中引用表单 [sfmActivites 子表单] 的过滤器的正确方法是什么??

非常感谢!

【问题讨论】:

  • 您始终可以存储全局引用并以这种方式获取它...如果不是这样,那么到目前为止您尝试过什么? Every suggestion from everywhere 无法帮助我们确定这些建议可能不起作用的原因。
  • 你是如何打开这个“弹出”表单的?您是通过代码创建它的实例,还是调用DoCmd?让我们看一些代码,以便我们为您提供帮助。
  • 哦,...如果是 Access-VBA,请这样标记问题。
  • 我通过使用从主窗体到第三个子窗体的完全限定引用,最终通过其 Filter 属性正确引用了第三个窗体,从而解决了这个问题。另外,我保存了过滤器并对其进行了无值测试或空字符串

标签: forms vba


【解决方案1】:

您的问题非常概念性,因此此答案可能适用于您的特定问题。

我曾经必须创建一个涉及主从数据的 CRUD 应用程序,并且我必须在 Excel VBA 中完成,并且无法访问数据库......所以我编写了针对 抽象的代码 并实现了 Model-View-PresenterCommandRepository+UnitOfWork 模式...可能 稍微满足您的需求。

无论这个解决方案多么矫枉过正,它与 VBA 一样可靠,并且允许我为我想要使用的每个“主”和“详细信息”表重复使用相同的表单/视图 - 再次,您的帖子并不清楚您正在做什么,所以我只是要公开对我有用的解决方案。这是正确的方式吗?取决于你在做什么。这对我来说是正确的方法,因为我可以使用模拟数据测试整个功能,当我到达办公室并将工作单元换成实际连接到数据库的工作单元时,一切正常 .

关键是Presenter知道它的MasterId,如果有DetailsPresenter

IP演示者

Option Explicit

Public Property Get UnitOfWork() As IUnitOfWork
End Property

Public Property Set UnitOfWork(ByVal value As IUnitOfWork)
End Property

Public Property Get View() As IView
End Property

Public Property Set View(ByVal value As IView)
End Property

Public Sub Show()
End Sub

Public Function ExecuteCommand(ByVal commandId As CommandType) As Variant
End Function

Public Function CanExecuteCommand(ByVal commandId As CommandType) As Boolean
End Function

Public Property Get DetailsPresenter() As IPresenter
End Property

Public Property Set DetailsPresenter(ByVal value As IPresenter)
End Property

Public Property Get MasterId() As Long
End Property

Public Property Let MasterId(ByVal value As Long)
End Property

假设我有一个CategoriesPresenter 和一个SubCategoriesPresenter,我可以像这样实现CategoriesPresenter

Option Explicit

Private Type tPresenter
    UnitOfWork As IUnitOfWork
    DetailsPresenter As IPresenter
    View As IView
End Type

Private this As tPresenter
Implements IPresenter
Implements IDisposable

Public Property Get UnitOfWork() As IUnitOfWork
    Set UnitOfWork = this.UnitOfWork
End Property

Public Property Set UnitOfWork(ByVal value As IUnitOfWork)
    Set this.UnitOfWork = value
End Property

Public Property Get View() As IView
    Set View = this.View
End Property

Public Property Set View(ByVal value As IView)
    Set this.View = value
End Property

Public Property Get DetailsPresenter() As IPresenter
    Set DetailsPresenter = this.DetailsPresenter
End Property

Public Property Set DetailsPresenter(ByVal value As IPresenter)
    Set this.DetailsPresenter = value
End Property

Public Sub Show()
    IPresenter_ExecuteCommand RefreshCommand
    View.Show
End Sub

Private Function NewCategory(Optional ByVal id As Long = 0, Optional ByVal description As String = vbNullString) As SqlResultRow
    
    Dim result As SqlResultRow
    
    Dim values As New Dictionary
    values.Add "id", id
    values.Add "description", description
    
    Set result = UnitOfWork.Repository("Categories").NewItem(View.Model, values)
    Set NewCategory = result
    
End Function

Private Sub Class_Terminate()
    Dispose
End Sub

Private Sub Dispose()
    
    If Not View Is Nothing Then Unload View
    
    Disposable.Dispose this.UnitOfWork
    Disposable.Dispose this.DetailsPresenter
    
    Set this.UnitOfWork = Nothing
    Set this.View = Nothing
    Set this.DetailsPresenter = Nothing
    
End Sub

Private Sub IDisposable_Dispose()
    Dispose
End Sub

Private Function IPresenter_CanExecuteCommand(ByVal commandId As CommandType) As Boolean
    
    Dim result As Boolean
    
    Select Case commandId
        Case CommandType.CloseCommand, CommandType.RefreshCommand, CommandType.AddCommand
            result = True
            
        Case CommandType.DeleteCommand, _
             CommandType.EditCommand
            result = (Not View.SelectedItem Is Nothing)
            
        Case CommandType.ShowDetailsCommand
            If View.SelectedItem Is Nothing Then Exit Function
            result = GetDetailsModel.Count > 0
            
    End Select
    
    IPresenter_CanExecuteCommand = result
    
End Function

Private Property Set IPresenter_DetailsPresenter(ByVal value As IPresenter)
    Set DetailsPresenter = value
End Property

Private Property Get IPresenter_DetailsPresenter() As IPresenter
    Set IPresenter_DetailsPresenter = DetailsPresenter
End Property

Private Function GetDetailsModel() As SqlResult
    Set GetDetailsModel = DetailsPresenter.UnitOfWork.Repository("SubCategories") _
                                                     .GetAll _
                                                     .WhereFieldEquals("CategoryId", View.SelectedItem("Id"))
End Function

Private Function IPresenter_ExecuteCommand(ByVal commandId As CommandType) As Variant
    
    Select Case commandId
        Case CommandType.CloseCommand
            View.Hide
            
        Case CommandType.RefreshCommand
            Set View.Model = UnitOfWork.Repository("Categories").GetAll
            
        Case CommandType.ShowDetailsCommand
            Set DetailsPresenter.View.Model = GetDetailsModel
            DetailsPresenter.MasterId = View.SelectedItem("id")
            DetailsPresenter.Show
        
        Case CommandType.AddCommand
            ExecuteAddCommand
            
        Case CommandType.DeleteCommand
            ExecuteDeleteCommand
            
        Case CommandType.EditCommand
            ExecuteEditCommand
            
    End Select
    
End Function

Private Sub ExecuteAddCommand()
    
    Dim description As String
    If Not RequestUserInput(prompt:=GetResourceString("AddCategoryMessageText"), _
                            title:=GetResourceString("AddPromptTitle"), _
                            outResult:=description, _
                            default:=GetResourceString("DefaultCategoryDescription")) _
    Then
        Exit Sub
    End If
    
    UnitOfWork.Repository("Categories").Add NewCategory(description:=description)
    UnitOfWork.Commit
    IPresenter_ExecuteCommand RefreshCommand

End Sub

Private Sub ExecuteDeleteCommand()

    Dim id As Long
    id = View.SelectedItem("id")
    
    Dim childRecords As Long
    childRecords = GetDetailsModel.Count
    
    If childRecords > 0 Then
        MsgBox StringFormat(GetResourceString("CannotDeleteItemWithChildItemsMessageText"), childRecords), _
               vbExclamation, _
               GetResourceString("CannotDeleteItemWithChildItemsMessageTitle")
        Exit Sub
    End If
    
    If RequestUserConfirmation(StringFormat(GetResourceString("ConfirmDeleteItemMessageText"), id)) Then
        UnitOfWork.Repository("Categories").Remove id
        UnitOfWork.Commit
        IPresenter_ExecuteCommand RefreshCommand
    End If

End Sub

Private Sub ExecuteEditCommand()
    
    Dim id As Long
    id = View.SelectedItem("id")
    
    Dim description As String
    If Not RequestUserInput(prompt:=StringFormat(GetResourceString("EditCategoryDescriptionText"), id), _
                            title:=GetResourceString("EditPromptTitle"), _
                            outResult:=description, _
                            default:=View.SelectedItem("description")) _
    Then
        Exit Sub
    End If
    
    UnitOfWork.Repository("Categories").Update id, NewCategory(id, description)
    UnitOfWork.Commit
    IPresenter_ExecuteCommand RefreshCommand

End Sub

Private Property Let IPresenter_MasterId(ByVal value As Long)
'not implemented
End Property

Private Property Get IPresenter_MasterId() As Long
'not implemented
End Property

Private Property Set IPresenter_UnitOfWork(ByVal value As IUnitOfWork)
    Set UnitOfWork = value
End Property

Private Property Get IPresenter_UnitOfWork() As IUnitOfWork
    Set IPresenter_UnitOfWork = UnitOfWork
End Property

Private Sub IPresenter_Show()
    Show
End Sub

Private Property Set IPresenter_View(ByVal value As IView)
    Set View = value
End Property

Private Property Get IPresenter_View() As IView
    Set IPresenter_View = View
End Property

SubCategoriesPresenter 看起来像这样:

Option Explicit

Private Type tPresenter
    MasterId As Long
    UnitOfWork As IUnitOfWork
    DetailsPresenter As IPresenter
    View As IView
End Type

Private this As tPresenter
Implements IPresenter
Implements IDisposable

Private Function NewSubCategory(Optional ByVal id As Long = 0, Optional ByVal categoryId As Long = 0, Optional ByVal description As String = vbNullString) As SqlResultRow
    
    Dim result As SqlResultRow
    
    Dim values As New Dictionary
    values.Add "id", id
    values.Add "categoryid", categoryId
    values.Add "description", description
    
    Set result = UnitOfWork.Repository("SubCategories").NewItem(View.Model, values)
    Set NewSubCategory = result
    
End Function

Public Property Get UnitOfWork() As IUnitOfWork
    Set UnitOfWork = this.UnitOfWork
End Property

Public Property Set UnitOfWork(ByVal value As IUnitOfWork)
    Set this.UnitOfWork = value
End Property

Public Property Get View() As IView
    Set View = this.View
End Property

Public Property Set View(ByVal value As IView)
    Set this.View = value
    View.Resize width:=400
End Property

Public Sub Show()
    View.Show
End Sub

Private Sub Class_Terminate()
    Dispose
End Sub

Private Sub Dispose()

    If Not View Is Nothing Then Unload View
    Disposable.Dispose this.UnitOfWork
    Disposable.Dispose this.DetailsPresenter
    
    Set this.UnitOfWork = Nothing
    Set this.View = Nothing
    Set this.DetailsPresenter = Nothing

End Sub

Private Sub IDisposable_Dispose()
    Dispose
End Sub

Private Function IPresenter_CanExecuteCommand(ByVal commandId As CommandType) As Boolean
    
    Dim result As Boolean
    
    Select Case commandId
        
        Case CommandType.CloseCommand, _
             CommandType.RefreshCommand, _
             CommandType.AddCommand
            result = True
        
        Case CommandType.DeleteCommand, _
             CommandType.EditCommand
            result = (Not View.SelectedItem Is Nothing)
        
    End Select
    
    IPresenter_CanExecuteCommand = result

End Function

Private Property Set IPresenter_DetailsPresenter(ByVal value As IPresenter)
'not implemented
End Property

Private Property Get IPresenter_DetailsPresenter() As IPresenter
'not implemented
End Property

Private Sub ExecuteAddCommand()
    
    Dim description As String
    If Not RequestUserInput(prompt:=GetResourceString("AddSubCategoryMessageText"), _
                            title:=GetResourceString("AddPromptTitle"), _
                            outResult:=description, _
                            default:=GetResourceString("DefaultSubCategoryDescription")) _
    Then
        Exit Sub
    End If
    
    UnitOfWork.Repository("SubCategories").Add NewSubCategory(categoryId:=this.MasterId, description:=description)
    UnitOfWork.Commit
    IPresenter_ExecuteCommand RefreshCommand

End Sub

Private Sub ExecuteDeleteCommand()
    
    Dim id As Long
    id = View.SelectedItem("id")
    
    If RequestUserConfirmation(StringFormat(GetResourceString("ConfirmDeleteItemMessageText"), id)) Then
        UnitOfWork.Repository("SubCategories").Remove id
        UnitOfWork.Commit
        IPresenter_ExecuteCommand RefreshCommand
    End If

End Sub

Private Sub ExecuteEditCommand()
    
    Dim id As Long
    id = View.SelectedItem("id")
    
    Dim description As String
    If Not RequestUserInput(prompt:=StringFormat(GetResourceString("EditSubCategoryDescriptionText"), id), _
                            title:=GetResourceString("EditPromptTitle"), _
                            outResult:=description, _
                            default:=View.SelectedItem("description")) _
    Then
        Exit Sub
    End If
    
    UnitOfWork.Repository("SubCategories").Update id, NewSubCategory(id, this.MasterId, description)
    UnitOfWork.Commit
    IPresenter_ExecuteCommand RefreshCommand
    
End Sub

Private Function IPresenter_ExecuteCommand(ByVal commandId As CommandType) As Variant
    
    Select Case commandId
        
        Case CommandType.CloseCommand
            View.Hide
        
        Case CommandType.RefreshCommand
            Set View.Model = UnitOfWork.Repository("SubCategories") _
                                       .GetAll _
                                       .WhereFieldEquals("CategoryId", this.MasterId)
            
        Case CommandType.EditCommand
            ExecuteEditCommand
        
        Case CommandType.DeleteCommand
            ExecuteDeleteCommand
                
        Case CommandType.AddCommand
            ExecuteAddCommand
                
    End Select
    
End Function

Private Property Let IPresenter_MasterId(ByVal value As Long)
    this.MasterId = value
End Property

Private Property Get IPresenter_MasterId() As Long
    IPresenter_MasterId = this.MasterId
End Property

Private Property Set IPresenter_UnitOfWork(ByVal value As IUnitOfWork)
    Set UnitOfWork = value
End Property

Private Property Get IPresenter_UnitOfWork() As IUnitOfWork
    Set IPresenter_UnitOfWork = UnitOfWork
End Property

Private Sub IPresenter_Show()
    Show
End Sub

Private Property Set IPresenter_View(ByVal value As IView)
    Set View = value
End Property

Private Property Get IPresenter_View() As IView
    Set IPresenter_View = View
End Property

在您的情况下,您将在此处拥有一个 DetailsPresenter 实例,并且该子节点也将拥有自己的 DetailsPresenter 实例。


对我来说最困难的事情是执行命令。以下内容可能会有所帮助:

命令回调

Option Explicit

Private owner As IPresenter
Implements ICommandCallback

Public Property Get CallbackOwner() As IPresenter
    Set CallbackOwner = owner
End Property

Public Property Set CallbackOwner(ByVal value As IPresenter)
    Set owner = value
End Property

Private Property Set ICommandCallback_CallbackOwner(ByVal value As IPresenter)
    Set owner = value
End Property

Private Property Get ICommandCallback_CallbackOwner() As IPresenter
    Set ICommandCallback_CallbackOwner = owner
End Property

Private Function ICommandCallback_CanExecute(ByVal cmd As CommandType) As Boolean
    If owner Is Nothing Then Exit Function
    ICommandCallback_CanExecute = CallByName(owner, "CanExecuteCommand", VbMethod, cmd)
End Function

Private Sub ICommandCallback_Execute(ByVal cmd As CommandType)
    If owner Is Nothing Then Exit Sub
    If Not ICommandCallback_CanExecute(cmd) Then Exit Sub
    CallByName owner, "ExecuteCommand", VbMethod, cmd
End Sub

这让我可以将逻辑完全置于 view 之外,并进入 presenters

这是我的表单的代码隐藏:

Option Explicit

Private Type tView
    Model As SqlResult
    Selection As SqlResultRow
    Callback As ICommandCallback
End Type

Private this As tView

'MinSize is determined by design-time size.
Private minHeight As Integer
Private minWidth As Integer

Private layoutBindings As New List
Implements IView

Private Sub IView_Resize(Optional ByVal width As Integer, Optional ByVal height As Integer)
    If width <> 0 Then Me.width = width
    If height <> 0 Then Me.height = height
End Sub

Private Sub UserForm_Initialize()
    
    BindControlLayouts

    minHeight = Me.height
    minWidth = Me.width
    
End Sub

Private Sub BindControlLayouts()
    
    'todo: refactor this
    Dim buttonLeftAnchor As Integer
    buttonLeftAnchor = EditButton.Left

    Dim buttonMargin As Integer
    buttonMargin = 2

    EditKeyButton.Top = AddButton.Top
    EditDateButton.Top = EditKeyButton.Top + EditKeyButton.height + buttonMargin
    EditDescriptionButton.Top = EditDateButton.Top + EditDateButton.height + buttonMargin
    
    EditKeyButton.Left = buttonLeftAnchor
    EditDateButton.Left = buttonLeftAnchor
    EditDescriptionButton.Left = buttonLeftAnchor
    
    
    
    Dim instructionsLabelLayout As New ControlLayout
    instructionsLabelLayout.Bind Me, InstructionsLabel, AnchorAll
    
    Dim backgroundImageLayout As New ControlLayout
    backgroundImageLayout.Bind Me, BackgroundImage, AnchorAll
    
    Dim itemsListLayout As New ControlLayout
    itemsListLayout.Bind Me, ItemsList, AnchorAll
    
    Dim closeButtonLayout As New ControlLayout
    closeButtonLayout.Bind Me, CloseButton, BottomAnchor + RightAnchor
    
    Dim addButtonLayout As New ControlLayout
    addButtonLayout.Bind Me, AddButton, RightAnchor + TopAnchor
    
    Dim editButtonLayout As New ControlLayout
    editButtonLayout.Bind Me, EditButton, RightAnchor
    
    Dim showDetailsButtonLayout As New ControlLayout
    showDetailsButtonLayout.Bind Me, ShowDetailsButton, RightAnchor
    
    Dim deleteButtonLayout As New ControlLayout
    deleteButtonLayout.Bind Me, DeleteButton, RightAnchor
    
    Dim editKeyButtonLayout As New ControlLayout
    editKeyButtonLayout.Bind Me, EditKeyButton, RightAnchor
    
    Dim EditDateButtonLayout As New ControlLayout
    EditDateButtonLayout.Bind Me, EditDateButton, RightAnchor
    
    Dim EditDescriptionButtonLayout As New ControlLayout
    EditDescriptionButtonLayout.Bind Me, EditDescriptionButton, RightAnchor
    
    layoutBindings.Add closeButtonLayout, _
                       backgroundImageLayout, _
                       instructionsLabelLayout, _
                       itemsListLayout, _
                       addButtonLayout, _
                       editButtonLayout, _
                       showDetailsButtonLayout, _
                       deleteButtonLayout, _
                       editKeyButtonLayout, _
                       EditDateButtonLayout, _
                       EditDescriptionButtonLayout


End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    Cancel = True
    Hide
End Sub

Private Sub UserForm_Resize()

    Application.ScreenUpdating = False

    If Me.width < minWidth Then Me.width = minWidth
    If Me.height < minHeight Then Me.height = minHeight
    
    Dim layout As ControlLayout
    For Each layout In layoutBindings
        layout.Resize Me
    Next

    Application.ScreenUpdating = True

End Sub

Public Property Get Model() As SqlResult
    Set Model = this.Model
End Property

Public Property Set Model(ByVal value As SqlResult)
    Set this.Model = value
    OnModelChanged
End Property

Public Property Get SelectedItem() As SqlResultRow
    Set SelectedItem = this.Selection
End Property

Public Property Set SelectedItem(ByVal value As SqlResultRow)
    
    If (Not (value Is Nothing)) Then
        If (ObjPtr(value.ParentResult) <> ObjPtr(this.Model)) Then
            
            Set value.ParentResult = this.Model
        
        End If
    End If
    
    Set this.Selection = value
    EvaluateCanExecuteCommands
    
End Property

Private Sub EvaluateCanExecuteCommands()

    AddButton.Enabled = this.Callback.CanExecute(AddCommand)
    CloseButton.Enabled = this.Callback.CanExecute(CloseCommand)
    DeleteButton.Enabled = this.Callback.CanExecute(DeleteCommand)
    EditButton.Enabled = this.Callback.CanExecute(EditCommand)
    ShowDetailsButton.Enabled = this.Callback.CanExecute(ShowDetailsCommand)
    
    EditDateButton.Enabled = EditButton.Enabled
    EditDescriptionButton.Enabled = EditButton.Enabled
    EditKeyButton.Enabled = EditButton.Enabled
    
End Sub

Public Sub Initialize(cb As ICommandCallback, ByVal title As String, ByVal instructions As String, ByVal commands As ViewAction)
    
    Localize title, instructions
    Set this.Callback = cb
    
    AddButton.Visible = commands And ViewAction.Create
    EditButton.Visible = commands And ViewAction.Edit
    DeleteButton.Visible = commands And ViewAction.Delete
    ShowDetailsButton.Visible = commands And ViewAction.ShowDetails
    
    EditKeyButton.Visible = commands And ViewAction.EditKey
    EditDateButton.Visible = commands And ViewAction.EditDate
    EditDescriptionButton.Visible = commands And ViewAction.EditDescription
    
    If (commands And PowerEdit) = PowerEdit Then
        EditButton.Top = AddButton.Top
    Else
        EditButton.Top = AddButton.Top + AddButton.height + 2
    End If
    
End Sub

Private Sub Localize(ByVal title As String, ByVal instructions As String)
    
    Me.Caption = title
    InstructionsLabel.Caption = instructions
    
    CloseButton.Caption = GetResourceString("CloseButtonText")
    AddButton.ControlTipText = GetResourceString("AddButtonToolTip")
    EditButton.ControlTipText = GetResourceString("EditButtonToolTip")
    DeleteButton.ControlTipText = GetResourceString("DeleteButtonToolTip")
    ShowDetailsButton.ControlTipText = GetResourceString("ShowDetailsButtonToolTip")
    
End Sub

Private Sub OnModelChanged()
    
    ItemsList.Clear
    If this.Model Is Nothing Then Exit Sub
    this.Model.ValueSeparator = StringFormat("\t")
    
    Dim row As SqlResultRow
    For Each row In this.Model
        
        Set row.ParentResult = this.Model
        ItemsList.AddItem row.ToString
    
    Next
    
End Sub

Private Sub ExecuteCommandInternal(method As CommandType)
    If this.Callback Is Nothing Then Exit Sub
    If this.Callback.CallbackOwner Is Nothing Then Exit Sub
    this.Callback.Execute method
End Sub

Private Sub AddButton_Click()
    ExecuteCommandInternal AddCommand
End Sub

Private Sub DeleteButton_Click()
    ExecuteCommandInternal DeleteCommand
End Sub

Private Sub CloseButton_Click()
    ExecuteCommandInternal CloseCommand
End Sub

Private Sub EditButton_Click()
    ExecuteCommandInternal EditCommand
End Sub

Private Sub EditKeyButton_Click()
    ExecuteCommandInternal EditKeyCommand
End Sub

Private Sub ShowDetailsButton_Click()
    ExecuteCommandInternal ShowDetailsCommand
End Sub

Private Sub ItemsList_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    ExecuteCommandInternal EditCommand
End Sub

Private Sub ItemsList_Change()
    If ItemsList.ListIndex >= 0 Then
        Set SelectedItem = this.Model(ItemsList.ListIndex)
    Else
        Set SelectedItem = Nothing
    End If
End Sub

Private Sub IView_Initialize(cb As ICommandCallback, ByVal title As String, ByVal instructions As String, ByVal commands As ViewAction)
    Initialize cb, title, instructions, commands
End Sub

Private Property Get IView_CommandCallback() As ICommandCallback
    Set IView_CommandCallback = this.Callback
End Property

Private Property Set IView_Model(ByVal value As SqlResult)
    Set Model = value
End Property

Private Property Get IView_Model() As SqlResult
    Set IView_Model = Model
End Property

Private Property Set IView_SelectedItem(ByVal value As SqlResultRow)
    Set SelectedItem = value
End Property

Private Property Get IView_SelectedItem() As SqlResultRow
    Set IView_SelectedItem = SelectedItem
End Property

Private Sub IView_Show()
    Show
End Sub

Private Sub IView_Hide()
    Hide
End Sub

显然,如果没有我就该主题写一整系列的博客文章,您将无法按原样使用此代码。但我希望这足以说明这种方法。

或者,您可以采用简单的方法并使用Globals.bas 模块在表单之间共享值 - 在正确处理完成之间实现平衡>.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-28
    • 1970-01-01
    • 2017-12-17
    • 1970-01-01
    • 1970-01-01
    • 2023-03-29
    • 1970-01-01
    • 2018-02-10
    相关资源
    最近更新 更多