• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 508
  • Last Modified:

Code help for scanning.

Dears
This is what my code looks like

Private Sub cmdScan_Click()
 
  Dim objScan As ImgScan
  Set objScan = Me!ImgScan1.Object
  With objScan
    .DestImageControl = "ImgEdit1"  'Tell it which image to control
    .FileType = BMP_Bitmap 'Tell it what file type to use
    .ScanTo = DisplayAndFile 'Scan to the screen and the file
    .Image = "C:\Documents and Settings\Asim\My Documents\My Pictures\acdp3.gif" 'Give a temporary file name
    .StartScan 'Open the twain scanner screen
  End With

End Sub

Private Sub ImgScan1_ScanDone()
'This event process after the scan is completed
 
  Dim objScan As ImgScan
  Set objScan = Me!ImgScan1.Object
  With objScan
    .CloseScanner
  End With
 
  With Me!OLEPicture
    .OLETypeAllowed = acOLEEmbedded 'Allow embedded OLE types
    .Class = "Paint.Picture" 'Insert the type of picture you want
    .SourceDoc = "C:\My Documents\TempImg.bmp" 'Tell the OLE control which picture to use
    .Action = acOLECreateEmbed 'Store the image in the database
  End With

'Delete the temporary file
  Kill "C:\My Documents\TempImg.bmp"
End Sub


I have used the chestysoft active-x. But when I run this code it gives me errors

I need help immediately as I have to put this proposal to work soon.

Thank You
Asim
0
syedasimmeesaq
Asked:
syedasimmeesaq
  • 9
  • 3
  • 3
1 Solution
 
Jeffrey CoachmanMIS LiasonCommented:
What is the exact error you are getting?
On what line does it occur?
0
 
syedasimmeesaqAuthor Commented:
It says

Compile error
User-defined type not defined.

Its in a windows warrning box, after I click the command button.

Thanks
0
 
syedasimmeesaqAuthor Commented:
It also highlights thius section of the code

Private Sub cmdScan_Click()
 
  Dim objScan As ImgScan
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Jeffrey CoachmanMIS LiasonCommented:
Sounds like you ar missing the Reference to "ImgScan"


From Microsoft Knowledgebase:
You are referring to an object in an object library that you do not have referenced.

You must add a reference to the object library that contains the object that you are using in code. To do so, follow these steps:
1. Open any module in the database that is generating the error described in the "Symptoms" section of this article.  
2. On the Debug menu, click Compile All Modules. Note the line of code that is highlighted when you receive the error message.  
3. On the Tools menu, click References.  
4. Click to select the object library that contains the object referenced by the line of code that is highlighted.

Here is the Microsoft link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;182342

Let me know if this helps

0
 
syedasimmeesaqAuthor Commented:
I am trying it now. I will update you. Thanks
0
 
syedasimmeesaqAuthor Commented:
Nope ..there is nothing to add. Everything that I think was necessary is already there.
0
 
syedasimmeesaqAuthor Commented:
I checked all the available reference and still the same thing .
All I need is to be able to use my scanner and scan the pictures of the employees with their information like phone number and stuff but as time is passing by I think I wouldn't get any help to do that.
0
 
Jeffrey CoachmanMIS LiasonCommented:
Here are two links to investigate

The first is a simple way to get the image into the database
Thes second appears to be the same code you have posted here

See if the first way might be simpler.
Re-read the second in case you just copied the code and did not see the full text.

http://www.experts-exchange.com/Databases/MS_Access/Q_10067440.html?query=scanner&topics=39
http://www.experts-exchange.com/Databases/MS_Access/Q_10303255.html?query=scanner&topics=39

That's all I can suggest

Good luck
0
 
Gustav BrockCIOCommented:
First, add a reference to csXImageTrial Library (that's the ocx file).

Then dim like this:

  Dim csx As csXImageTrial.ImageBox

Also, download and play with the Access Demo file. This shows the traditional method of adding the control to the form and then refer to that control.

/gustav
0
 
syedasimmeesaqAuthor Commented:
I don't know what I did... Can you tell me step by step process
Thanks
0
 
syedasimmeesaqAuthor Commented:
Please help . This is really urgent
0
 
Gustav BrockCIOCommented:
But did you get the demo file? It works.
It's much easier to study that.

/gustav
0
 
syedasimmeesaqAuthor Commented:
Which demo file ...I tried looking for it..didn't find it
0
 
syedasimmeesaqAuthor Commented:
ok can we do this way
Lets say that I have employee name and address, and when I go to his record it just pulls up his picture. But it should be so easy that the lady who is using the computer(really a little knowledge of computers) can update the new employees pictures? Do you guys think would it be simple to do and get it going by this weekend???
I appreciate any comments
Thank You
0
 
Gustav BrockCIOCommented:
> Which demo file

One page down here:

http://www.chestysoft.com/ximage/

/gustav
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 9
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now