[AccessD] A2k form control undo

Charlotte Foust cfoust at infostatsystems.com
Fri Aug 24 11:03:10 CDT 2007


If this is unbound, there isn't a value to return to.  I usually handle
that by assigning the initial value to a variable or to the control's
tag property so I can simply reset the control to that value if they
cancel.  As for your second question, I don't see any code assigning
myPath to the strFileNm control.

Charlotte Foust   

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of O'Connor,
Patricia (OTDA)
Sent: Friday, August 24, 2007 8:47 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] A2k form control undo

When I try to undo a control the original text does not display in the
control on the form. I have even tried to repaint the form but that
doesn't help.. 
Also if the person does select another file - the new file name will not
show up on form even after the AFTER_UPDATE 


Thanks
**************************************************
* Patricia O'Connor
* Associate Computer Programmer Analyst
* OTDA - BDMA
* (W) mailto:Patricia.O'Connor at otda.state.ny.us
* (w) mailto:aa1160 at nysemail.state.ny.us
**************************************************
  

Private Sub strFileNm_BeforeUpdate(Cancel As Integer)
    Dim myPath As String
    strFilter = "Rpt Files(*Bic*.txt; *.txt)" & vbNullChar &
"*RPT*.txt;*.TXT;*.DOC;*.XLS"
    myPath = strFileNm
    If IsNull(strFileNm.text) Or strFileNm.text = "" Then
       GoTo strFileNm_BeforeUpdate_GetFile
    ElseIf Not (Len(Dir$(myPath)) > 0) Then
           If MsgBox("This file not found " & vbLf & strFileNm & vbLf &
_
                     "Do you want to Search?", vbYesNo, "RPT File Name")
= vbYES Then
              GoTo strFileNm_BeforeUpdate_GetFile
           Else
               Cancel = True
               'Me.strFileNm.Undo   'Tried both these
               'Me!strFileNm.Undo
               strFileNm.Undo
               Me.Repaint         'added this - still does not show
original value
               Exit Sub
           End If
    End If
    Exit Sub
    
strFileNm_BeforeUpdate_GetFile:
    myPath = tsGetFileFromUser(, gstrPPathFTP, strFilter, , "txt", ,
"RPT Import Files", True)
    If IsNull(myPath) Then
       Cancel = True
       Me.strFileNm.Undo
       Exit Sub
    End If
    
End Sub
--------------------------------------------------------
This e-mail, including any attachments, may be confidential, privileged
or otherwise legally protected. It is intended only for the addressee.
If you received this e-mail in error or from someone who was not
authorized to send it to you, do not disseminate, copy or otherwise use
this e-mail or its attachments.  Please notify the sender immediately by
reply e-mail and delete the e-mail from your system.


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list