|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
File Name Returned Problem
I am trying to paste a FileNameReturned String into an filed on my form but I receive the following error:
Run-time error '3163' The filed is too small to accept the amount of data you attemped to add. Try inserting or pasting less data. The code used is as follows (not mine I got from someone else): Private Sub Command8_Click() Dim msaof As MSA_OPENFILENAME Dim strStartPath As String, Strg As String msaof.strDialogTitle = "Please Select Image File...." If strStartPath = "" Then msaof.strInitialDir = "C:\" Else msaof.strInitialDir = strStartPath msaof.strFilter = MSA_CreateFilterString("All Files (*.*)", "*.*") msaof.strInitialFile = "" MSA_GetSaveFileName msaof If Trim(msaof.strFullPathReturned) <> "" Then Strg = Trim(msaof.strFullPathReturned) Strg = Trim(Strg) If Right$(Strg, 1) <> "\" Then Dim i As Integer, c As String For i = Len(Strg) To 1 Step -1 c = Mid(Strg, i, 1) If c = "\" Then Exit For Next i a = Left$(Strg, (Len(Strg) - (Len(Strg) - i))) End If WhateverVariableOrControl = Strg Me!FilePath = Strg If Trim(msaof.strFileNameReturned) <> "" Then Strg1 = Trim(msaof.strFileNameReturned) Strg1 = Trim(Strg1) If Right$(Strg1, 1) <> "\" Then Dim ii As Integer, cc As String For ii = Len(Strg1) To 1 Step -1 cc = Mid(Strg1, ii, 1) If cc = "\" Then Exit For Next ii aa = Left$(Strg1, (Len(Strg1) - (Len(Strg1) - ii))) End If WhateverVariableOrControl = Strg1 FileCopy Strg, "c:\temp\" & Strg1 Me!Filename = Strg1 End Sub This code allows me to open a dialog box, pick a file, return the Filename & path in a field and copy that file to another Directory. I added some of the code above so that I can Save the Filename in another field for me to link to a report. The Me!Filename is the name of the field in my table. If there is a way for me to extract the filename from the fullpathreturned String that will work for me as well. Any help is appreciated. Thanks, Dan |
|
#2
|
|||
|
|||
|
try the following, it works in VB
sInputFileName = Dir(sInputFullPath&FileName) S- |
|
#3
|
|||
|
|||
|
It work with a slight mod to it:
InputFilename = Dir([Strg1], vbNormal) Thanks Again.. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > File Name Returned Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|