フォーム上のチェックボックスのみ削除する
配列でチェックボックスに格納し
削除する。っていうか、そうしたいんだが
これでは1つずつしか削除できんです。
なんで?イミディエイトでは列挙できているんだけど...
まとめて削除する方法がわからん!
Sub DelCtrl() Dim MyForm As Form Dim MyControl As Control Dim CtrlName() As String Dim CtrlCnt As Long Dim x As Long Set MyForm = Forms!FREHASub For Each MyControl In MyForm.Controls CtrlCnt = MyForm.Controls.Count ReDim Preserve CtrlName(CtrlCnt - 1) CtrlName(x) = MyControl.NAME If MyControl.ControlType = acCheckBox Then Debug.Print CtrlName(x) DeleteControl FormsName, CtrlName(x) End If Next End Sub