Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 10th, 2003, 11:49 AM
danboy29 danboy29 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 9 danboy29 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old December 10th, 2003, 01:30 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
try the following, it works in VB
sInputFileName = Dir(sInputFullPath&FileName)

S-

Reply With Quote
  #3  
Old December 10th, 2003, 04:20 PM
danboy29 danboy29 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 9 danboy29 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It work with a slight mod to it:

InputFilename = Dir([Strg1], vbNormal)

Thanks Again..

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > File Name Returned Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway