?
Solved

Code help for scanning.

Posted on 2005-05-10
15
Medium Priority
?
503 Views
Last Modified: 2008-03-04
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
Comment
Question by:syedasimmeesaq
  • 9
  • 3
  • 3
15 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 13974192
What is the exact error you are getting?
On what line does it occur?
0
 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 13974434
It says

Compile error
User-defined type not defined.

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

Thanks
0
 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 13974526
It also highlights thius section of the code

Private Sub cmdScan_Click()
 
  Dim objScan As ImgScan
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 13974732
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
 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 13975399
I am trying it now. I will update you. Thanks
0
 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 13975441
Nope ..there is nothing to add. Everything that I think was necessary is already there.
0
 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 13975469
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 13978312
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
 
LVL 52

Expert Comment

by:Gustav Brock
ID: 13978743
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
 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 13982431
I don't know what I did... Can you tell me step by step process
Thanks
0
 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 13982965
Please help . This is really urgent
0
 
LVL 52

Expert Comment

by:Gustav Brock
ID: 13988637
But did you get the demo file? It works.
It's much easier to study that.

/gustav
0
 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 13989679
Which demo file ...I tried looking for it..didn't find it
0
 
LVL 9

Author Comment

by:syedasimmeesaq
ID: 13991530
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
 
LVL 52

Accepted Solution

by:
Gustav Brock earned 2000 total points
ID: 13993759
> Which demo file

One page down here:

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

/gustav
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question