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 / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

OLEControls Optionbuttons

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jan Vente - 21 Mar 2006 08:47 GMT
Hi all,

In an Excel workbook I created a multiplechoice test. On the first sheet
they select the test. On the second sheet they make the questions. The
questions are in cells The possible answers are in Optionbuttons
(OLEControls).
The problem is: After selecting the text the right questions show up, but
the anwers in the captions of the optionsbuttons only show up after clicking
in the worksheet and after a delay of a few secons. There are 300
optionsbuttons (100 questions with 3 possible answers).

The code for filling the controls is (part of a larger procedure):

Do Until rs.EOF
       For Each oleObj In wsVragen.OLEObjects
           If TypeOf oleObj.Object Is MSForms.OptionButton Then
               Set optObj = oleObj.Object
               VraagNo = Mid(optObj.Name, 5, Len(optObj.Name) - 5)
               AntwoordTeken = Right(optObj.Name, 1)

               If rs!Vraagnummer = VraagNo And rs!Antwoordletter =
AntwoordTeken Then
                   oleObj.Visible = True
                   optObj.Caption = rs!Antwoord & ""
               End If
           End If
       Next oleObj
       rs.MoveNext
   Loop
   rs.MoveFirst

Vraag = Dutch for Question
Antwoord = Dutch for Answer

The question is: Why are the captions of the optionbuttons refreshed after
running the code with delay? How Can I solve this problem?

TIA,
Jan Vente
Tom Ogilvy - 21 Mar 2006 14:01 GMT
Perhaps the delay is in the record set.

Try commenting out the code that works with the OLEObjects and just steps
through the record set.  Does that take close to the same time.  If so,
perhaps you can put the recordset into an array and work from that.  

Signature

Regards,
Tom Ogilvy

> Hi all,
>
[quoted text clipped - 35 lines]
> TIA,
> Jan Vente
 
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.