![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a push button that adds the value from a combobox in a text box. How to get an alert (message) if the value in the combobox is not set (=empty)? This is the code (I have it simplified): Private Sub AddName_Click() Me.Refresh If Len(Me.Textbox & "") > 0 Then If not IsNull(Me.Combo43) then |
|
End If End Sub |
#3
| |||
| |||
|
|
I have a push button that adds the value from a combobox in a text box. How to get an alert (message) if the value in the combobox is not set (=empty)? This is the code (I have it simplified): Private Sub AddName_Click() Me.Refresh If Len(Me.Textbox & "") > 0 Then Me.Textbox = Me.Textbox & Me!Combo43.Value & vbCrLf End If If Len(Me.Textbox & "") = 0 Then Me.Textbox = Me.Textbox & Me!Combo43.Value & vbCrLf End If End Sub |
#4
| |||
| |||
|
|
Why not disable the push button until the combo box if filled? In the form's on current event if nz(Me!Combo42.Value,"") = "" then * * Me!AddName.Enabled *= False else * * Me!AddName.Enabled = True endif In the After update event of the combo box if nz(Me!Combo42.Value,"") = "" then ' User may have deleted the selection * * Me!AddName.Enabled *= False else * * Me!AddName.Enabled = True endif "AA Arens" <bartvandon... (AT) gmail (DOT) com> wrote in message news:1ea6d9c4-fc38-4e53-abdb-400e114fe6b6 (AT) p10g2000prm (DOT) googlegroups.com... I have a push button that adds the value from a combobox in a text box. How to get an alert (message) if the value in the combobox is not set (=empty)? This is the code (I have it simplified): Private Sub AddName_Click() * Me.Refresh If Len(Me.Textbox & "") > 0 Then * Me.Textbox = Me.Textbox & Me!Combo43.Value & vbCrLf End If If Len(Me.Textbox & "") = 0 Then * Me.Textbox = Me.Textbox & Me!Combo43.Value & vbCrLf End If End Sub |
#5
| |||
| |||
|
|
On Jul 29, 7:47*pm, "paii, Ron" <n... (AT) no (DOT) com> wrote: Why not disable the push button until the combo box if filled? In the form's on current event if nz(Me!Combo42.Value,"") = "" then * * Me!AddName.Enabled *= False else * * Me!AddName.Enabled = True endif In the After update event of the combo box if nz(Me!Combo42.Value,"") = "" then ' User may have deleted the selection * * Me!AddName.Enabled *= False else * * Me!AddName.Enabled = True endif "AA Arens" <bartvandon... (AT) gmail (DOT) com> wrote in message news:1ea6d9c4-fc38-4e53-abdb-400e114fe6b6 (AT) p10g2000prm (DOT) googlegroups.com.... I have a push button that adds the value from a combobox in a text box. How to get an alert (message) if the value in the combobox is not set (=empty)? This is the code (I have it simplified): Private Sub AddName_Click() * Me.Refresh If Len(Me.Textbox & "") > 0 Then * Me.Textbox = Me.Textbox & Me!Combo43.Value & vbCrLf End If If Len(Me.Textbox & "") = 0 Then * Me.Textbox = Me.Textbox & Me!Combo43.Value & vbCrLf End If End Sub Thanks, I used the last solution. Elegant. |
#6
| |||
| |||
|
|
On Jul 29, 7:47 pm, "paii, Ron" <n... (AT) no (DOT) com> wrote: Why not disable the push button until the combo box if filled? In the form's on current event if nz(Me!Combo42.Value,"") = "" then Me!AddName.Enabled = False else Me!AddName.Enabled = True endif In the After update event of the combo box if nz(Me!Combo42.Value,"") = "" then ' User may have deleted the selection Me!AddName.Enabled = False else Me!AddName.Enabled = True endif "AA Arens" <bartvandon... (AT) gmail (DOT) com> wrote in message news:1ea6d9c4-fc38-4e53-abdb-400e114fe6b6 (AT) p10g2000prm (DOT) googlegroups.com... I have a push button that adds the value from a combobox in a text box. How to get an alert (message) if the value in the combobox is not set (=empty)? This is the code (I have it simplified): Private Sub AddName_Click() Me.Refresh If Len(Me.Textbox & "") > 0 Then Me.Textbox = Me.Textbox & Me!Combo43.Value & vbCrLf End If If Len(Me.Textbox & "") = 0 Then Me.Textbox = Me.Textbox & Me!Combo43.Value & vbCrLf End If End Sub Thanks, I used the last solution. Elegant. |
![]() |
| Thread Tools | |
| Display Modes | |
| |