Question : How to populate unbound controls on a continuous form in Access 2007

I have a continuous form bound to a non-updatable recordset.  Let's assume for a moment that there's a really good reason for that and there's no easy way to either make the recordset updatable or to bind the form to a temp table.

I want to make two of the textbox controls on this form unbound, but assign them a value from the underlying form record source as they are displayed.  Since they are unbound I'll be able to edit values in these textboxes and use textbox events to execute some SQL to update the real values in the underlying tables.

I've been trying to make this assignment in the OnPaint event of the detail section of my form and this does in fact work, but generates huge flicker because I'm guessing the assignments are causing other paint events to get fired.  Anyone have experience trying to do what I'm trying to do and have any suggestions?  I tried setting a module level variable with the record key and only letting the OnPaint event update the values once per record but this seems to have no effect (see the code section for my OnPaint event.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
Private Sub Detail_Paint()
    'On Error Resume Next
    
    If mlngSplitID <> Me.SplitID Then
        Me.tbSplitAmount = Me.SplitAmount.Value
        Me.tbOfficeCode = Me.OfficeCode.Value
        mlngSplitID = Me.SplitID
    
        If Me.SplitError = -1 Then
            Me.tbSplitAmount.BackColor = vbRed
        Else
            Me.tbSplitAmount.BackColor = vbWhite
        End If
    End If
End Sub

Answer : How to populate unbound controls on a continuous form in Access 2007

That's quite interesting, although it's obviously based on an optical illusion (I suppose you could justifiably respond by saying all perception of screen content is based on an optical illusion(:-) ).

I don't know if MS expected this new event to be used in this way and unless thay did, I guess they would say that the feature is 'working as intended'.

I can't think of anything you could change to remove the flicker (short of running the app on the most powerful hardware around, and seeing if that improved the refresh rate)
Random Solutions  
 
programming4us programming4us