Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

Need Help Displaying TextBoxes on User Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JBNewsGroup - 30 Nov 2004 12:23 GMT
Hi

I have code that cycles though a document's tables.  The purpose is to
validate table fields.

As each table cell is accessed I want to populate a text box and display the
data for that cell.

I only get the display for the last table and its last cell. I can display
using the Statusbar but I

would prefer using the form fields.

How do I display the data in a form's text box while a document table is
being accessed?

I am using WORD 2000 and the code is as follows:

----------------------------------------------------------------------------
---------------------------------------------

Private Sub ValidateTables()

   Application.ScreenUpdating = False

   For Each oTable In ActiveDocument.Tables

       With oTable.Rows(1).Cells(1).Range

           .MoveEnd Unit:=wdCharacter, Count:=-1

           TableName = .Text

       End With

       fraValidation.Caption = TableName

       NumRows = oTable.Rows.Count

       Set oRow = oTable.Rows(3).Range

       For RowCount = 1 To NumRows - 3

           For Each oCell In oRow.Rows(1).Cells

               Select Case oCell.ColumnIndex

                   Case 1

                       If CellHilight(oCell) Then Exit For

                       CatNo = GetText(oCell)

                       txtCatNumber.Text = CatNo

                   Case 2, 3

                       ValueText = GetText(oCell)

                       txtCurrentValue.Text = ValueText

                       Call ValidateValue(ValueText, ErrorText)

                      If  ErrorDetected then  Call CorrectError (ErrorText)

                End Select

           Next oCell

'

' Prefer to use Forms's Textboxes

'

          StatusBar = TableName & Space(4) & ValueText & Space(4) & "Cat
No:  " & CatNo

           Set oRow = oRow.Next(wdRow)

       Next Counter

   Next oTable

   Application.ScreenUpdating = True

End Sub

----------------------------------------------------------------------------
---------------------------------------------

Thanks in advance for any help and advice or tips.

Jerry Bodoff
JBNewsGroup - 01 Dec 2004 07:09 GMT
Hi,

Ignore this question.  I solved the problem by inserting a DoEvents in the
process loop.

Jerry Bodoff
> Hi
>
[quoted text clipped - 90 lines]
>
> Jerry Bodoff

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.