Private Sub CB1_Click() CB2.Visible = False End Sub ---------------------------------------------------------------------------- Private Sub CB2_Click() CB1.Visible = False End Sub ----------------------------------------------------------------------------- Private Sub CB3_Click() Unload 既存注文 End Sub ----------------------------------------------------------------------------- Private Sub Label1_Click() MsgBox "これはすでに注文した" & vbCrLf & "注文書の番号です" End Sub ----------------------------------------------------------------------------- Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) 'ユーザーがタイトル バーの [×] ボタンを使用して閉じないようにします。 If CloseMode <> 1 Then Cancel = 1 既存注文.Caption = "[×] ボタンは使えません。[検索]をクリックしてくだい。" End Sub ----------------------------------------------------------------------------- Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) 'ユーザーがタイトル バーの [×] ボタンを使用して閉じないようにします。 If CloseMode <> vbFormCode Then Cancel = True End If End Sub