Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2005

Tip: Looking for answers? Try searching our database.

Events inside loop affected

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy G - 08 Jul 2005 15:34 GMT
I have a big loop in the OnOpen event of a form.  Inside this loop I want to
change the color of these boxes as the records are processed.  It seems like
when the myControl.BackColor = vbBlue is ran inside the loop it doesn't have
an event to make it change.  The color of the boxes change after a msgbox is
thrown after the line of code to change the box color.

Any ideas?
fredg - 08 Jul 2005 15:50 GMT
> I have a big loop in the OnOpen event of a form.  Inside this loop I want to
> change the color of these boxes as the records are processed.  It seems like
[quoted text clipped - 3 lines]
>
> Any ideas?

You're probably using the wrong event, but without seeing the code,
and without more information, I won't try to give any suggestions.

Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Andy G - 08 Jul 2005 16:34 GMT
Below is a snippet of the code I am using.  The even that fires all of this
code is a button click.

Do While Not rsHolding.EOF
   'A bunch of code here using recordsets to update and insert records.

    recCounter = recCounter + 1
    If recCounter = incCounter Then
           strControl = box & boxCounter
           Me.Controls(strControl).BackColor = vbBlue
           incCounter = incCounter + 3
           boxCounter = boxCounter + 1
    End If
Loop

msgbox "Import complete"

The boxes that are sopose to turn blue as the loop process don't update
until the above msgbox comes up.  The code in that if statement just checks
if the number of records processed equals 3, and then fills in one of the
boxes on the screen for an progress bar effect.

Hopefully this helps a little more.

>> I have a big loop in the OnOpen event of a form.  Inside this loop I want
>> to
[quoted text clipped - 10 lines]
> You're probably using the wrong event, but without seeing the code,
> and without more information, I won't try to give any suggestions.
Klatuu - 08 Jul 2005 16:51 GMT
See added code below

> Below is a snippet of the code I am using.  The even that fires all of this
> code is a button click.
[quoted text clipped - 6 lines]
>             strControl = box & boxCounter
>             Me.Controls(strControl).BackColor = vbBlue
              Me.Repaint
>             incCounter = incCounter + 3
>             boxCounter = boxCounter + 1
[quoted text clipped - 24 lines]
> > You're probably using the wrong event, but without seeing the code,
> > and without more information, I won't try to give any suggestions.
Andy G - 08 Jul 2005 17:20 GMT
Ahhhhhh!  I tried requery and refresh but not repaint, which makes perfect
sense.

You made my day.

Thanks.
Andy

> See added code below
>
[quoted text clipped - 43 lines]
>> > You're probably using the wrong event, but without seeing the code,
>> > and without more information, I won't try to give any suggestions.
 
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.