Access 2007 Control of the attachment control and scanned data

  • Thread starter Thread starter RAM
  • Start date Start date
R

RAM

I have a two part question: First I have an attachment control that I would
like to use coding to regulate the attachments. Each customer will have a
folder on the C drive with scanned images of various data. The second part
of the question is can I control the scanner from access so it scans the
document to the associated client folder. If this is the wrong place to ask
these questions please excuse me and if you could please point me in the
right direction.

Thanks in advance
 
Pete thank you, I will work with the products and the attachment code and let
you know how it comes out.

Once again thank you
 
Pete if you are out there, or any one who can help. I have the scanner
working, but I get an error when I try to save the image to a folder within a
folder on my hard drive. If I only use one folder it works OK. But I really
need to save to a folder within a folder. Here is the code I'm using.
Thanks in advance for help.

Images = folder 1 and PTfolder = folder 2

strFile = "c:\Images\PTFolder\" & [PTName] & [ID] & [LblImage] & [Date]
strType = "bmp"
A = Scanner1.Save(strFile, strType)

If A = 1 Then
MsgBox "Save " + strFile + "." + strType + " Complete"
Else
MsgBox "Save fail"
End If
 
My suggestion is to use a save box. http://www.mvps.org/access/ provides
the code for saving but if you want to hard code it you need to debug your
code. I think if you display in debugger each part of c:\Images\PTFolder\"
& [PTName] & [ID] & [LblImage] & [Date]
you will find you need to add & "\" or a "." to dig down.
RAM said:
Pete if you are out there, or any one who can help. I have the scanner
working, but I get an error when I try to save the image to a folder
within a
folder on my hard drive. If I only use one folder it works OK. But I
really
need to save to a folder within a folder. Here is the code I'm using.
Thanks in advance for help.

Images = folder 1 and PTfolder = folder 2

strFile = "c:\Images\PTFolder\" & [PTName] & [ID] & [LblImage] & [Date]
strType = "bmp"
A = Scanner1.Save(strFile, strType)

If A = 1 Then
MsgBox "Save " + strFile + "." + strType + " Complete"
Else
MsgBox "Save fail"
End If

--
AccessRAM


RAM said:
Pete thank you, I will work with the products and the attachment code and
let
you know how it comes out.

Once again thank you
 
I tried this:
c:\Images.PTFolder\" & [PTName] & [ID] & [LblImage] & [Date]

But it goes to the C drive not the folders.

I then tried:
"c:\BobImages.PTFolder\" & [PTName] & [ID] & [LblImage]
and the image save failed.

I tried:
strFile = "c:\BobImages\.PTFolder" & [PTName] & [ID] & [LblImage]
and the image goes to the file BobImages.

I still can not get the second file folder open.

Any other suggestions.


Thanks

Bob



--
AccessRAM


Pete D. said:
My suggestion is to use a save box. http://www.mvps.org/access/ provides
the code for saving but if you want to hard code it you need to debug your
code. I think if you display in debugger each part of c:\Images\PTFolder\"
& [PTName] & [ID] & [LblImage] & [Date]
you will find you need to add & "\" or a "." to dig down.
RAM said:
Pete if you are out there, or any one who can help. I have the scanner
working, but I get an error when I try to save the image to a folder
within a
folder on my hard drive. If I only use one folder it works OK. But I
really
need to save to a folder within a folder. Here is the code I'm using.
Thanks in advance for help.

Images = folder 1 and PTfolder = folder 2

strFile = "c:\Images\PTFolder\" & [PTName] & [ID] & [LblImage] & [Date]
strType = "bmp"
A = Scanner1.Save(strFile, strType)

If A = 1 Then
MsgBox "Save " + strFile + "." + strType + " Complete"
Else
MsgBox "Save fail"
End If

--
AccessRAM


RAM said:
Pete thank you, I will work with the products and the attachment code and
let
you know how it comes out.

Once again thank you
--
AccessRAM


:

If scanner is twain complient you can use VB/VBA to control it.

http://www.dosadi.com/vbtwaincode.htm
http://www.softpicks.net/download.php?index=30951

For the attachment part see

http://blogs.msdn.com/access/archiv...-the-new-attachment-field-in-access-2007.aspx

I haven't had a reason to do this yet but I looks pretty easy

I have a two part question: First I have an attachment control that I
would
like to use coding to regulate the attachments. Each customer will
have a
folder on the C drive with scanned images of various data. The
second
part
of the question is can I control the scanner from access so it scans
the
document to the associated client folder. If this is the wrong place
to
ask
these questions please excuse me and if you could please point me in
the
right direction.

Thanks in advance
 
First off We need to know what you are really creating.
Open up the debugger and at the top of your code add something like

Dim strMyNewFile as string

then put
strMyNewFile = "c:\Images\PTFolder\" & [PTName] & [ID] & [LblImage] & [Date]

Then select strMyNewFile right click and add a watch. Click to the left of
it on the border wich will put a red dot on border. This is now a break
point, your code will stop there. Run you application, when it stops press
F8 once. At the bottom of the screen look and see what the watch sees in
strMyNewFile, once you can see what you created you can edit the string to
correct it. Also I don't understand the period in you string between
Images.PTFolder. It appears you just don't have a valid file/path string.
Once you get that right pass the strMyNewFile to the file name instead of
the string. Easier to find your problem with your


RAM said:
I tried this:
c:\Images.PTFolder\" & [PTName] & [ID] & [LblImage] & [Date]

But it goes to the C drive not the folders.

I then tried:
"c:\BobImages.PTFolder\" & [PTName] & [ID] & [LblImage]
and the image save failed.

I tried:
strFile = "c:\BobImages\.PTFolder" & [PTName] & [ID] & [LblImage]
and the image goes to the file BobImages.

I still can not get the second file folder open.

Any other suggestions.


Thanks

Bob



--
AccessRAM


Pete D. said:
My suggestion is to use a save box. http://www.mvps.org/access/ provides
the code for saving but if you want to hard code it you need to debug
your
code. I think if you display in debugger each part of
c:\Images\PTFolder\"
& [PTName] & [ID] & [LblImage] & [Date]
you will find you need to add & "\" or a "." to dig down.
RAM said:
Pete if you are out there, or any one who can help. I have the scanner
working, but I get an error when I try to save the image to a folder
within a
folder on my hard drive. If I only use one folder it works OK. But I
really
need to save to a folder within a folder. Here is the code I'm using.
Thanks in advance for help.

Images = folder 1 and PTfolder = folder 2

strFile = "c:\Images\PTFolder\" & [PTName] & [ID] & [LblImage] & [Date]
strType = "bmp"
A = Scanner1.Save(strFile, strType)

If A = 1 Then
MsgBox "Save " + strFile + "." + strType + " Complete"
Else
MsgBox "Save fail"
End If

--
AccessRAM


:

Pete thank you, I will work with the products and the attachment code
and
let
you know how it comes out.

Once again thank you
--
AccessRAM


:

If scanner is twain complient you can use VB/VBA to control it.

http://www.dosadi.com/vbtwaincode.htm
http://www.softpicks.net/download.php?index=30951

For the attachment part see

http://blogs.msdn.com/access/archiv...-the-new-attachment-field-in-access-2007.aspx

I haven't had a reason to do this yet but I looks pretty easy

I have a two part question: First I have an attachment control
that I
would
like to use coding to regulate the attachments. Each customer
will
have a
folder on the C drive with scanned images of various data. The
second
part
of the question is can I control the scanner from access so it
scans
the
document to the associated client folder. If this is the wrong
place
to
ask
these questions please excuse me and if you could please point me
in
the
right direction.

Thanks in advance
 
Pete can you e-mail me at (e-mail address removed) and I will send you a more
detailed example with some screen shots. I'm sorry but I can't describe the
process as well in the discussion page.

Thanks

Bob
 
Solution worked out
strFile = "c:\BobImages\" & [PTFolder] & "\" & [PTName] & [ID] & [LblImage]
& " " & Format([LblSDate], "dd mmm yyyy")
Fixed quotes and format of date.

Pete D. said:
First off We need to know what you are really creating.
Open up the debugger and at the top of your code add something like

Dim strMyNewFile as string

then put
strMyNewFile = "c:\Images\PTFolder\" & [PTName] & [ID] & [LblImage] &
[Date]

Then select strMyNewFile right click and add a watch. Click to the left
of it on the border wich will put a red dot on border. This is now a
break point, your code will stop there. Run you application, when it
stops press F8 once. At the bottom of the screen look and see what the
watch sees in strMyNewFile, once you can see what you created you can edit
the string to correct it. Also I don't understand the period in you
string between Images.PTFolder. It appears you just don't have a valid
file/path string. Once you get that right pass the strMyNewFile to the
file name instead of the string. Easier to find your problem with your


RAM said:
I tried this:
c:\Images.PTFolder\" & [PTName] & [ID] & [LblImage] & [Date]

But it goes to the C drive not the folders.

I then tried:
"c:\BobImages.PTFolder\" & [PTName] & [ID] & [LblImage]
and the image save failed.

I tried:
strFile = "c:\BobImages\.PTFolder" & [PTName] & [ID] & [LblImage]
and the image goes to the file BobImages.

I still can not get the second file folder open.

Any other suggestions.


Thanks

Bob



--
AccessRAM


Pete D. said:
My suggestion is to use a save box. http://www.mvps.org/access/
provides
the code for saving but if you want to hard code it you need to debug
your
code. I think if you display in debugger each part of
c:\Images\PTFolder\"
& [PTName] & [ID] & [LblImage] & [Date]
you will find you need to add & "\" or a "." to dig down.
Pete if you are out there, or any one who can help. I have the
scanner
working, but I get an error when I try to save the image to a folder
within a
folder on my hard drive. If I only use one folder it works OK. But I
really
need to save to a folder within a folder. Here is the code I'm using.
Thanks in advance for help.

Images = folder 1 and PTfolder = folder 2

strFile = "c:\Images\PTFolder\" & [PTName] & [ID] & [LblImage] &
[Date]
strType = "bmp"
A = Scanner1.Save(strFile, strType)

If A = 1 Then
MsgBox "Save " + strFile + "." + strType + " Complete"
Else
MsgBox "Save fail"
End If

--
AccessRAM


:

Pete thank you, I will work with the products and the attachment code
and
let
you know how it comes out.

Once again thank you
--
AccessRAM


:

If scanner is twain complient you can use VB/VBA to control it.

http://www.dosadi.com/vbtwaincode.htm
http://www.softpicks.net/download.php?index=30951

For the attachment part see

http://blogs.msdn.com/access/archiv...-the-new-attachment-field-in-access-2007.aspx

I haven't had a reason to do this yet but I looks pretty easy

I have a two part question: First I have an attachment control
that I
would
like to use coding to regulate the attachments. Each customer
will
have a
folder on the C drive with scanned images of various data. The
second
part
of the question is can I control the scanner from access so it
scans
the
document to the associated client folder. If this is the wrong
place
to
ask
these questions please excuse me and if you could please point me
in
the
right direction.

Thanks in advance
 
Back
Top