Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Kenny Kenny is offline
external usenet poster
 
Posts: 23
Default User Form Problems

1. In my combobox1 click I need a stmnt to goto the next tab. The one I am
using also turns my num lock on and off?

2. I need to clear the controls in userform1 upon exit of the userform?

3. How do you BOLD a ref field for a bookmark?

4. How can I code hyphens to be placed in text placed in SSN spot and phone
number spot?

Thanks for the help!

Private Sub ComboBox1_Click()
SendKeys "{TAB}"
End Sub

Private Sub CommandButton1_Click()
Dim oBMs As Bookmarks
Dim oRng As Word.Range
Set oBMs = ActiveDocument.Bookmarks
Select Case ComboBox1.Text
Case "Army"
Set oRng = oBMs("Locator").Range
oRng.Text = "HRC - Indianapolis" _
& vbCr & "ATTN: AHRC-ERP" & vbCr & "8899 East 56th Street" _
& vbCr & "Indianapolis, IN 46249-5301"
oBMs.Add "Locator", oRng
Case "Navy"
Set oRng = oBMs("Locator").Range
oRng.Text = "World Wide Locator" _
& vbCr & "Bureau of Naval Personnel" & vbCr & "PERS 312F" _
& vbCr & "5720 Integrity Drive" & vbCr & "Millington, TN 38055-3120"
oBMs.Add "Locator", oRng
Case "Air Force"
Set oRng = oBMs("Locator").Range
oRng.Text = "HQ AFPC/DPDXIDL" _
& vbCr & "550 C. Street West, Suite 50" & vbCr & "Randolph AFB, TX
78150-4752"
oBMs.Add "Locator", oRng
Case "Marines"
Set oRng = oBMs("Locator").Range
oRng.Text = "Headquarters USMC" _
& vbCr & "Personnel Management Support Branch (MMSB-17)" _
& vbCr & "2008 Elliot Road" & vbCr & "Quantico, VA 22134-5030"
oBMs.Add "Locator", oRng
End Select
Set oRng = oBMs("CustomersName").Range
oRng.Text = Me.TextBox1.Text
oBMs.Add "CustomersName", oRng
Set oRng = oBMs("AccountNumber").Range
oRng.Text = Me.TextBox2.Text
oBMs.Add "AccountNumber", oRng
Set oRng = oBMs("SocialNumber").Range
oRng.Text = Me.TextBox3.Text
oBMs.Add "SocialNumber", oRng
Set oRng = oBMs("CSRName").Range
oRng.Text = Me.TextBox4.Text
oBMs.Add "CSRName", oRng
Set oRng = oBMs("CSRPhone").Range
oRng.Text = Me.TextBox5.Text
oBMs.Add "CSRPhone", oRng
Set oRng = oBMs("Amount").Range
pastdue = Format$(Me.TextBox6.Text, "Currency")
oRng.Text = pastdue
oBMs.Add "Amount", oRng
ActiveDocument.Fields.Update
UserForm1.Hide
End Sub

Private Sub UserForm_Initialize()
ComboBox1.AddItem "Army"
ComboBox1.AddItem "Navy"
ComboBox1.AddItem "Air Force"
ComboBox1.AddItem "Marines"
ComboBox1.Style = fmStyleDropDownList
ComboBox1.BoundColumn = 0
ComboBox1.ListIndex = 0
End Sub






 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I allow a user to add attachments to a form? Ben1980 Microsoft Word Help 0 June 19th 07 01:31 PM
Inserting checkboxes on a user form RobertPearson via OfficeKB.com New Users 1 June 22nd 06 08:19 PM
User form Mark Microsoft Word Help 1 April 9th 06 05:06 PM
Attempting to disable all user functionality in a form except for form entry [email protected] Microsoft Word Help 1 February 6th 06 03:37 PM
User Form Tasks mully New Users 2 June 1st 05 07:40 PM


All times are GMT +1. The time now is 07:43 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"