小弟是初學者,所以只會基本的。
假設共有四個textbox(以下簡稱tb)
tb5、tb6為一組但獨立;tb7、tb8為一組但獨立
因為是寫給別人用的,
所以要考慮所有可能性,
他有可能只有輸入tb5及tb6,然後tb7忘記刪除,所以就有以下的答案。
If TB5.Value <> "" And TB6.Value <> "" And TB7.Value <> "" Then
MsgBox "請擇一輸入"
GoTo END1
End If
如果輸入tb5,結果tb7忘記刪除,或者是本來是要輸入tb7的,tb5忘記刪除。
If TB5.Value <> "" And TB7.Value <> "" Then
MsgBox "請擇一輸入"
GoTo END1
End If
如果輸入tb6,結果tb7忘記刪除,或者是本來是要輸入tb7的,tb6忘記刪除。
If TB6.Value <> "" And TB7.Value <> "" Then
MsgBox "請擇一輸入"
GoTo END1
End If
以此類推;這些都是小弟寫的;
If TB6.Value <> "" And TB8.Value <> "" Then
MsgBox "請擇一輸入"
GoTo END1
End If
If TB5.Value <> "" And TB6.Value <> "" And TB7.Value <> "" And TB8.Value <> "" Then
MsgBox "請擇一輸入"
GoTo END1
End If
If TB5.Value <> "" And TB7.Value <> "" And TB8.Value <> "" Then
MsgBox "請擇一輸入"
GoTo END1
End If
If TB6.Value <> "" And TB7.Value <> "" And TB8.Value <> "" Then
MsgBox "請擇一輸入"
GoTo END1
End If
If TB5.Value <> "" And TB6.Value <> "" And TB8.Value <> "" Then
MsgBox "請擇一輸入"
GoTo END1
End If
If TB5.Value = "" And TB6.Value = "" And TB7.Value = "" And TB8.Value = "" Then
MsgBox "請擇一輸入"
GoTo END1
End If