NaruZsuzsi
New Member
- Joined
- Jul 26, 2017
- Messages
- 5
Hey,
Could you help me please? Although I'm still a beginner but enthusiastic.
I would like to "build" a database. When the excel starts a UserForm pops-up and asking for the information from my group (colleagues). I'd like to force those TextBoxes (and a ComboBox and 2 CheckBoxes and one OptionButton from 2) to be mandatory to fill in. If one or more of those are empty a MsgBox would remind the user. First I planned to list the empty fields but later I simplified my thoughts to a MsgBox with the text stg like this: "You have an empty field left. Please fill all the boxes!". It seemed easier to achieve, but how to do it?
In the first version I found complicated the several possibility. There are 9 TextBoxes, 1 ComboBox, 2 OptionButtons, 2 CheckBoxes. What if 2 or 3 or 4 are empty etc... And wanted to list those to different lines which are empty. Is it possible in an easy way?
Anyhow the second version would be perfect if anyone could help me.
Private Sub EnterDataButton_Click2()
' Dialog's Title
strTitle = "Missing contract information"
If NameTextBox.Value = "" Or PartnerTextBox.Value = "" _
Or EmailTextBox.Value = "" Or ResponsibleTextBox.Value = "" _
Or ContactTextBox.Value = "" Or TypeComboBox.Value = "" _
Or EffectiveTextBox.Value = "" Or ExpiryTextBox.Value = "" _
Or LinkPdfTextBox.Value = "" Then
MsgBox "You must complete all fields, some boxes are still empty! ", vbCritical
Exit Sub
End If
'ContractDataUserForm1.Hide
End Sub
Or have some business with:
'strMsg1 = "You must complete Partner's name"
'strMsg2 = "You must complete Partner's contact person"
'strMsg3 = "You must complete Partner's e-mail address"
'strMsg4 = "You must complete C-level manager"
'strMsg5 = "You must complete contact"
'strMsg6 = "You must select type of contract"
'strMsg7 = "You must complete Effective date"
'strMsg8 = "You must complete Expiry date"
'strMsg9 = "You must complete Link for .pdf"
'MsgBox strMsg1 _
'& vbCrLf & strMsg2 _
'& vbCrLf & strMsg3 _
'& vbCrLf & strMsg4 _
'& vbCrLf & strMsg5 _
'& vbCrLf & strMsg6 _
'& vbCrLf & strMsg7 _
'& vbCrLf & strMsg8 _
'& vbCrLf & strMsg9 _
Please don't laugh on me I read several cases and solutions but none of those related close enough to my "problem".
Thanks in advance if you can help me.
Could you help me please? Although I'm still a beginner but enthusiastic.
I would like to "build" a database. When the excel starts a UserForm pops-up and asking for the information from my group (colleagues). I'd like to force those TextBoxes (and a ComboBox and 2 CheckBoxes and one OptionButton from 2) to be mandatory to fill in. If one or more of those are empty a MsgBox would remind the user. First I planned to list the empty fields but later I simplified my thoughts to a MsgBox with the text stg like this: "You have an empty field left. Please fill all the boxes!". It seemed easier to achieve, but how to do it?
In the first version I found complicated the several possibility. There are 9 TextBoxes, 1 ComboBox, 2 OptionButtons, 2 CheckBoxes. What if 2 or 3 or 4 are empty etc... And wanted to list those to different lines which are empty. Is it possible in an easy way?
Anyhow the second version would be perfect if anyone could help me.
Private Sub EnterDataButton_Click2()
' Dialog's Title
strTitle = "Missing contract information"
If NameTextBox.Value = "" Or PartnerTextBox.Value = "" _
Or EmailTextBox.Value = "" Or ResponsibleTextBox.Value = "" _
Or ContactTextBox.Value = "" Or TypeComboBox.Value = "" _
Or EffectiveTextBox.Value = "" Or ExpiryTextBox.Value = "" _
Or LinkPdfTextBox.Value = "" Then
MsgBox "You must complete all fields, some boxes are still empty! ", vbCritical
Exit Sub
End If
'ContractDataUserForm1.Hide
End Sub
Or have some business with:
'strMsg1 = "You must complete Partner's name"
'strMsg2 = "You must complete Partner's contact person"
'strMsg3 = "You must complete Partner's e-mail address"
'strMsg4 = "You must complete C-level manager"
'strMsg5 = "You must complete contact"
'strMsg6 = "You must select type of contract"
'strMsg7 = "You must complete Effective date"
'strMsg8 = "You must complete Expiry date"
'strMsg9 = "You must complete Link for .pdf"
'MsgBox strMsg1 _
'& vbCrLf & strMsg2 _
'& vbCrLf & strMsg3 _
'& vbCrLf & strMsg4 _
'& vbCrLf & strMsg5 _
'& vbCrLf & strMsg6 _
'& vbCrLf & strMsg7 _
'& vbCrLf & strMsg8 _
'& vbCrLf & strMsg9 _
Please don't laugh on me I read several cases and solutions but none of those related close enough to my "problem".
Thanks in advance if you can help me.