Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Text Box not showing inputted value

I am trying to initialise a form. I would like it clear all the text boxes,
except the last one should be popluated with "Yes" (but the user can enter
whatever info is appropriate is "yes" is not). The set.focus command works,
but the last box is still empty. What am I doing wrong?

Private Sub EnterNewConsult_Initialize()

txtStore.Value = ""

txtCustomerName.Value = ""

txtClosed.Value = "yes"

txtStore.SetFocus

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Text Box not showing inputted value

Change this:

Private Sub EnterNewConsult_Initialize()

To this:

Private Sub UserForm_Initialize()

It does not recognize the UserForm name for the Initialize event, It has to
be the constant provided by microsoft.

"Jacy Erdelt" wrote:

I am trying to initialise a form. I would like it clear all the text boxes,
except the last one should be popluated with "Yes" (but the user can enter
whatever info is appropriate is "yes" is not). The set.focus command works,
but the last box is still empty. What am I doing wrong?

Private Sub EnterNewConsult_Initialize()

txtStore.Value = ""

txtCustomerName.Value = ""

txtClosed.Value = "yes"

txtStore.SetFocus

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Text Box not showing inputted value

Try this:
Private Sub cmdNewPT_Click() 'my CommandButton is named 'cmdNewPT'...change
this to match the name of your button!!
Dim C As MSForms.Control
For Each C In Me.Controls
If TypeOf C Is MSForms.TextBox Then
C.Text = ""
End If
Next C
End Sub

Regards,
Ryan---
--
RyGuy


"JLGWhiz" wrote:

Change this:

Private Sub EnterNewConsult_Initialize()

To this:

Private Sub UserForm_Initialize()

It does not recognize the UserForm name for the Initialize event, It has to
be the constant provided by microsoft.

"Jacy Erdelt" wrote:

I am trying to initialise a form. I would like it clear all the text boxes,
except the last one should be popluated with "Yes" (but the user can enter
whatever info is appropriate is "yes" is not). The set.focus command works,
but the last box is still empty. What am I doing wrong?

Private Sub EnterNewConsult_Initialize()

txtStore.Value = ""

txtCustomerName.Value = ""

txtClosed.Value = "yes"

txtStore.SetFocus

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Text Box not showing inputted value

Huh? Ryan, are you on the correct thread?

"ryguy7272" wrote:

Try this:
Private Sub cmdNewPT_Click() 'my CommandButton is named 'cmdNewPT'...change
this to match the name of your button!!
Dim C As MSForms.Control
For Each C In Me.Controls
If TypeOf C Is MSForms.TextBox Then
C.Text = ""
End If
Next C
End Sub

Regards,
Ryan---
--
RyGuy


"JLGWhiz" wrote:

Change this:

Private Sub EnterNewConsult_Initialize()

To this:

Private Sub UserForm_Initialize()

It does not recognize the UserForm name for the Initialize event, It has to
be the constant provided by microsoft.

"Jacy Erdelt" wrote:

I am trying to initialise a form. I would like it clear all the text boxes,
except the last one should be popluated with "Yes" (but the user can enter
whatever info is appropriate is "yes" is not). The set.focus command works,
but the last box is still empty. What am I doing wrong?

Private Sub EnterNewConsult_Initialize()

txtStore.Value = ""

txtCustomerName.Value = ""

txtClosed.Value = "yes"

txtStore.SetFocus

End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Text Box not showing inputted value

I read clear all the text boxes'. I forgot about the part about the 'last
one should be popluated with "Yes"'. My code clears all text boxes; I use
the code occasionally and it works great. What did I miss?

Thanks,
Ryan---

--
RyGuy


"JLGWhiz" wrote:

Huh? Ryan, are you on the correct thread?

"ryguy7272" wrote:

Try this:
Private Sub cmdNewPT_Click() 'my CommandButton is named 'cmdNewPT'...change
this to match the name of your button!!
Dim C As MSForms.Control
For Each C In Me.Controls
If TypeOf C Is MSForms.TextBox Then
C.Text = ""
End If
Next C
End Sub

Regards,
Ryan---
--
RyGuy


"JLGWhiz" wrote:

Change this:

Private Sub EnterNewConsult_Initialize()

To this:

Private Sub UserForm_Initialize()

It does not recognize the UserForm name for the Initialize event, It has to
be the constant provided by microsoft.

"Jacy Erdelt" wrote:

I am trying to initialise a form. I would like it clear all the text boxes,
except the last one should be popluated with "Yes" (but the user can enter
whatever info is appropriate is "yes" is not). The set.focus command works,
but the last box is still empty. What am I doing wrong?

Private Sub EnterNewConsult_Initialize()

txtStore.Value = ""

txtCustomerName.Value = ""

txtClosed.Value = "yes"

txtStore.SetFocus

End Sub



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Text Box not showing inputted value

I think it will work OK if he uses the correct syntax for the
UserForm_Initialize event. I thought you had posted to the wrong thread.

"ryguy7272" wrote:

I read clear all the text boxes'. I forgot about the part about the 'last
one should be popluated with "Yes"'. My code clears all text boxes; I use
the code occasionally and it works great. What did I miss?

Thanks,
Ryan---

--
RyGuy


"JLGWhiz" wrote:

Huh? Ryan, are you on the correct thread?

"ryguy7272" wrote:

Try this:
Private Sub cmdNewPT_Click() 'my CommandButton is named 'cmdNewPT'...change
this to match the name of your button!!
Dim C As MSForms.Control
For Each C In Me.Controls
If TypeOf C Is MSForms.TextBox Then
C.Text = ""
End If
Next C
End Sub

Regards,
Ryan---
--
RyGuy


"JLGWhiz" wrote:

Change this:

Private Sub EnterNewConsult_Initialize()

To this:

Private Sub UserForm_Initialize()

It does not recognize the UserForm name for the Initialize event, It has to
be the constant provided by microsoft.

"Jacy Erdelt" wrote:

I am trying to initialise a form. I would like it clear all the text boxes,
except the last one should be popluated with "Yes" (but the user can enter
whatever info is appropriate is "yes" is not). The set.focus command works,
but the last box is still empty. What am I doing wrong?

Private Sub EnterNewConsult_Initialize()

txtStore.Value = ""

txtCustomerName.Value = ""

txtClosed.Value = "yes"

txtStore.SetFocus

End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Changes itself after I have inputted. Funky Excel Discussion (Misc queries) 5 September 27th 07 01:25 PM
Autofilter to tak on an Inputted Value mmc308 Excel Programming 2 May 19th 07 06:15 PM
Getting Last Value that inputted instereo911 via OfficeKB.com Excel Discussion (Misc queries) 0 April 25th 07 07:51 PM
Read Last Inputted Value? Yin99 Excel Programming 2 July 19th 06 03:56 AM
Due date changes when new value is inputted in a different column John Excel Programming 3 November 11th 05 05:53 PM


All times are GMT +1. The time now is 08:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"