ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Textbox values (https://www.excelbanter.com/excel-programming/332276-textbox-values.html)

browie

Textbox values
 
I am wanting to have the values m or f to be inputted into textbox5. Iam
not sure of how to do this I have put a little code as I think will work but
I would also like to have a messagebox appear if any textbox is left blank
that they must have a value.



If Val(TextBox5.Text) = "m"

Thanks




browie

Textbox values
 
Thanks for that

Browie
"Snake Plissken" wrote in message
...

firstible:

if TextBox5.value = "m" then...


secondly - here is a sample code that helps to determine blank value of

any
textbox on a form

Dim oCtl As MSForms.Control

For Each oCtl In name_of_form.Controls
If TypeName(oCtl) = "TextBox" Then

if oCtl.Value = "" then
msgbox (oCtl.name & " has no value!")
end if
End If
Next oCtl



I am wanting to have the values m or f to be inputted into textbox5. Iam
not sure of how to do this I have put a little code as I think will work
but
I would also like to have a messagebox appear if any textbox is left
blank
that they must have a value.



If Val(TextBox5.Text) = "m"

Thanks







Bob Phillips[_7_]

Textbox values
 
Why not use a combobox, with those values, and the user can select from
them. You can check on some type of form exit whether a selection has been
made

If ComboBox1.ListIndex < 0 Then
'do something
End If


--
HTH

Bob Phillips

"browie" wrote in message
...
I am wanting to have the values m or f to be inputted into textbox5. Iam
not sure of how to do this I have put a little code as I think will work

but
I would also like to have a messagebox appear if any textbox is left blank
that they must have a value.



If Val(TextBox5.Text) = "m"

Thanks






Snake Plissken[_2_]

Textbox values
 

firstible:

if TextBox5.value = "m" then...


secondly - here is a sample code that helps to determine blank value of any
textbox on a form

Dim oCtl As MSForms.Control

For Each oCtl In name_of_form.Controls
If TypeName(oCtl) = "TextBox" Then

if oCtl.Value = "" then
msgbox (oCtl.name & " has no value!")
end if
End If
Next oCtl



I am wanting to have the values m or f to be inputted into textbox5. Iam
not sure of how to do this I have put a little code as I think will work
but
I would also like to have a messagebox appear if any textbox is left
blank
that they must have a value.



If Val(TextBox5.Text) = "m"

Thanks






All times are GMT +1. The time now is 11:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com