O'Connor, Patricia (OTDA)
Patricia.O'Connor at otda.state.ny.us
Fri Aug 24 12:43:54 CDT 2007
It is unbound but I did have a DEFAULT value assigned. Will try setting the tag to the default value. The reason I use the myPath is because when I used If Not (Len(Dir$(strFileNm)) > 0) the DIR$ was not working correctly. If the file was not really found it would not go to the GetFile. When I move strFileNm to mypath it works correctly and will go to the GetFile if that file is not found. THANK YOU Patti ************************************************** * 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 = "Bic Files(*Bic*.txt; *.txt)" & vbNullChar & "*Bic*.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, "Bic File Name") = vbYes Then GoTo strFileNm_BeforeUpdate_GetFile Else Cancel = True 'Me.strFileNm.Undo 'Me!strFileNm.Undo strFileNm.Undo Me.Repaint Exit Sub End If End If Exit Sub strFileNm_BeforeUpdate_GetFile: myPath = tsGetFileFromUser(, gstrPPathFTP, strFilter, , "txt", , "Bic 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. -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Charlotte Foust > Sent: Friday, August 24, 2007 12:03 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] A2k form control undo > > 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 >