J
Jim
I have this that I kludge together using other code I found: (I am a
newbie)
Sub EnterField()
Dim dlg As frmPIDEntry
Set dlg = New frmPIDEntry
With dlg
.bCancel = False
.Show
If Not .bCancel Then
ActiveDocument.FormFields( _
Selection.Bookmarks(1).Name).Result = _
.tbxDrug.Value & "-" & .tbxProtocol.Value & "-" &
..tbxDrug.Value & "-" & .tbxPID.Value
End If
End With
Set dlg = Nothing
End Sub
I use a Userform to drive this as data entry on a Word from. What I
want is to be able to remove leading zeros from values prior to the
Word field being filled. So for example if in the textbox .tbxProtocol
someone enters 007 or 017 it is converted to 7 (or 17). I thought I
could use CLng but I can't get it to work.
newbie)
Sub EnterField()
Dim dlg As frmPIDEntry
Set dlg = New frmPIDEntry
With dlg
.bCancel = False
.Show
If Not .bCancel Then
ActiveDocument.FormFields( _
Selection.Bookmarks(1).Name).Result = _
.tbxDrug.Value & "-" & .tbxProtocol.Value & "-" &
..tbxDrug.Value & "-" & .tbxPID.Value
End If
End With
Set dlg = Nothing
End Sub
I use a Userform to drive this as data entry on a Word from. What I
want is to be able to remove leading zeros from values prior to the
Word field being filled. So for example if in the textbox .tbxProtocol
someone enters 007 or 017 it is converted to 7 (or 17). I thought I
could use CLng but I can't get it to work.