Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unwanted List refreshing 1

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
I have a listbox on a subform. Its rowsource is:

SELECT TXMASTERS.ID1, TXCLIPS.ID2, " " AS Persons, TXCLIPS.NName AS Name, TXCLIPS.Comments, TXCLIPS.Start AS [Time In], TXCLIPS.End AS [Time Out], TXCLIPS.ID1
FROM TXMASTERS INNER JOIN TXCLIPS ON TXMASTERS.ID1 = TXCLIPS.ID1
WHERE (((TXCLIPS.ID1)=[FORMS]![Mainform1].[FORM].[ID1]))
ORDER BY TXCLIPS.ID2 DESC;

ie it gets filled with records that have the matching ID1 which is the parent table/Form primary key.

On the onclick event on the list I have:

Dim RS2 As Recordset
Set RS2 = Me.RecordsetClone
Me.RecordsetClone.FindFirst "[ID2] = " & Me![List25]
Me.Bookmark = RS2.Bookmark

Which makes the subform filter to the record matching ID2 loaded into the list.

The subform is bound to the table TXClips.

When the list is clicked, the Bookmark code causes the list to flash/refresh each time. Any ideas? Thanks
 
How are ya ZOR . . .

. . . perhaps this ([purple]and only this![/purple]):
Code:
[blue]Me.Recordset.FindFirst "[ID2] = " & Me![List25][/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
Many thanks. I tried it but its the same. On the first click it's okay, but further clicks cause listbox refreshing. If I remove the line WHERE (((TXCLIPS.ID1)=[FORMS]![Mainform1].[FORM].[ID1]))
from the listbox rowsource query it does not flicker. Does a mainform get refreshed during setting the recordset of a subform? Thanks
 
Does anyone else have any ideas on this as on clicking the list causes the list to flicker/flash/refresh or something. Users are complaining, thanks
 
Is the Control Source of the listbox set to anything?

Because what you are doing is refreshing the subform, and if the listbox is bound then it too will be refreshed.

 
Howdy ZOR . . .

Apologies on how deeply this thread was burried. [surprise]

Getting back on track we need to [blue]insure your SQL is correct.[/blue] I have a problem with the following:
Code:
[blue]WHERE (((TXCLIPS.ID1)=[purple][b][FORMS]![Mainform1].[FORM].[ID1][/b][/purple]))[/blue]
[purple][FORMS]![Mainform1].[FORM].[ID1][/purple] neither references a mainform or subform [surprise].
[ol][li]If referencing mainform, then it should be:
Code:
[blue][Forms]![[purple][b][i]MainFormName[/i][/b][/purple]]![ID1][/blue]
[/li]
[li]If referencing subform then it should be:
Code:
[blue][Forms]![[purple][b][i]MainFormName[/i][/b][/purple]]![[purple][b][i]subFormName[/i][/b][/purple]].Form![ID1][/blue]
[/li][/ol]
I'm surprised an error wasn't raised! [surprise]

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Sorry the delay getting back. Thanks Joe, but the control source is empty. Thanks TheAceMan1. I have put another listbox on the form. Its rowsource is now very basic.

SELECT TXCLIPS.ID2, TXMASTERS.ID1
FROM TXMASTERS INNER JOIN TXCLIPS ON TXMASTERS.ID1 = TXCLIPS.ID1
WHERE (((TXMASTERS.ID1)=[forms]![Mainform1].[ID1]));

and the onlick event is

Private Sub List247_Click()
Dim RS2 As Recordset
Set RS2 = Me.RecordsetClone

Me.RecordsetClone.FindFirst "[ID2] = " & Me![List247]
Me.Bookmark = RS2.Bookmark

End Sub

After the first click the liistbox is stable, however it still flickers after further clicks. Its driving me mad, as its only setting the subform source/record to the value of ID2 in the child table to which the subform is bound to.

Regards, thanks

 
ZOR . . .

I believe I see it!
Code:
[blue]   Set RS2 = Me.RecordsetClone[/blue]
You set an object RS2 to a clone. OK here!
Code:
[blue]   [purple][b]Me[/b][/purple].RecordsetClone.FindFirst "[ID2] = " & Me![List247][/blue]
Here you perform a search in a [purple]seperate clone[/purple] based on the form! [red]You've now incited two clones![/red]
Code:
[blue]   Me.Bookmark = RS2.Bookmark[/blue]
You set a bookmark via RS2 [red]where no search was peformed![/red] . . . Can you see it!
To cleanup should be:
Code:
[blue]    Dim RS2 As Recordset
    
    Set RS2 = Me.RecordsetClone
    
    [purple][b]RS2.FindFirst[/b][/purple] "[ID2] = " & Me![List247]
    Me.Bookmark = RS2.Bookmark

    Set RS2 = Nothing[/blue]
[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Many thanks. I was looking forward to killing this dead but it still flickers!! I have removed all events after this code, and all possible intrusions on the mainform (ie there is a timer for a clock, thought it might coincide with the list being clicked during time display) but the retched problems still there. I also reduced the number of records displayed in the list so all were shown, thinking it might be something there but to no solution. I did a very basic smaller db, and got the same problem. Maybe my Access 2003 is on the blink? Regards
 
Sorry about that ZOR . . .

Sounds like bug that may be fixed by a hotfix or service pak issue. 2003 has had filker problems else where: Flicker with tab controls

. . . also check out this hotfix: Access 2003 post-Service Pack 3 hotfix package:

Your problem represents one of the reasons why I have my clients wait two or more years before upgrading.

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Thanks, however I never installed serice pack 3, like you I am waiting until its reported clean. I also know about the flashing label problems on the tab control, I use text boxes instead of labels. I tried my code with Access 97 and the list is stable so something amiss in 2003, although surprised/worried nobody else is seeing this problem. Have done all the debugs under the sun, and it's just the Bookmark code thats causing the flicker. Will try and find the nearest cliff or river soon. Regards
 
The answers in Experts Exchange are at the bottom of their pages, just scroll down.

 
Many thanks Joe, you get a star for trolling through all the garbage on the page to find that. I just saw the information on the site saying why not join to see the answer?

I am suffering with the same problem as the guy in the thread, glad its not just me. Looks like I need to try adding a further subform which is a pain to overcome the problem. Access97 does not have this problem. I opened up someones Access2007 today and thought I was on another planet. Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top