Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Code Answer


Message #1 by "KennethMungwira" <KennethMungwira@Y...> on Fri, 19 Oct 2001 15:47:57
Thank you for your help but I have figured out my problem with the code:







For Each ctl In Me!ICsubStatusInfo.Form

                Select Case ctl.ControlType

                    Case acComboBox, acTextBox

                        If Not IsNull(ctl) Then

                        If ctl.Name <> "txtDaysToComplete" Then

                            ctl.Tag = ctl

                        End If

                        End If

                End Select

            Next ctl



Thank you
Message #2 by "Hamilton, Tom" <hamiltot@s...> on Fri, 19 Oct 2001 08:33:00 -0700
There is another possiblity, a little used property called control.oldvalue 

You can selectively restore certain controls to the former values or pass

the

change to a logging routine.  Just do the trapping on the AfterUpdate event

of

the controls, or your program can loop all type 'x' controls to log or undo.



Private Function fPostUpdate()

    Dim sOldVal As String, sNewVal As String

    sMsg = ""

    If Not IsNull(Screen.ActiveControl.OldValue) And Not NewRecord Then

        sOldVal = Screen.ActiveControl.OldValue

        sNewVal = Screen.ActiveControl

        sMsg = Screen.ActiveControl.name & " changed: " & sOldVal & " => " &

sNewVal

        debug.print sMsg ' OR  replace with your transaction logging, see

next

line

'       ProcessLog sMsg, , "High"

    End If

End Function





Tom Hamilton

T_Systems, Inc

Database Programmer

(xxx) xxx-xxxx



>>> KennethMungwira 10/19/01 08:47AM >>>

Thank you for your help but I have figured out my problem with the code:







For Each ctl In Me!ICsubStatusInfo.Form

                Select Case ctl.ControlType

                    Case acComboBox, acTextBox

                        If Not IsNull(ctl) Then

                        If ctl.Name <> "txtDaysToComplete" Then

                            ctl.Tag = ctl

                        End If

                        End If

                End Select

            Next ctl



Thank you

  Return to Index