Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InkPicture on Form 1

Status
Not open for further replies.

no1biscuit

Programmer
Oct 8, 2001
67
US
I am wanting to capture a signature and store it in the database. I see something about inkpicture here thread702-1238911 but does anyone have an example? It appears using nameofinkpicute.ink.save will save it but I don't know how to store it in the database and then retrieve it. Please help.... I have tried using paint in an OLE object but the size of the box it initially creates is square and thus does not really work since a signature is a rectangle.

Thanks in advance
Thom
 
when you say 'capture a signature' what do you mean. You can store a signature if all your trying to do is have the signature appear on a letter for example. Just copy and paste the signature in the desired position.



"Its not who you are that defines you, its what you do..." - Bruce Wayne
 
I have a umpc and am wanting the customer to sign on the touch screen and store that signature in the database when the given task is completed. I got the signature to work in an ole object where I open paint. I tried InkPicture and it appears to save in the ole object but I have no way of displaying it after it is in there.

Thanks for any and all help.

Thom
 
no1biscuit,
Here is a sample brought to you by my morning coffee. This was done in WinXP w/ Access 2k and simply allows me to:[ol][li]Create a signature and save it to a table.[/li][li]Load a previously saved signature from the table to the InkPicture control.[/li][/ol]

Table
[tt]Name : tblInkEdit
[tab]Field Data Type
[tab]ID : Autonumber
[tab]InkData : OLE Object[/tt]
Form
[tt]Name : frmInkPicture
[tab]Data Source : tblInkEdit
[tab]Control : Microsoft InkPicture Control
[tab][tab]Name : ActiveXCtl1
[tab]Control : Text Box
[tab][tab]Name : txtID
[tab][tab]Source : ID
[tab]Control : Command Button
[tab][tab]Name : Command3
[tab][tab]Caption : Save
Code:
Private Sub Command3_Click()
Me.InkData = Me.ActiveXCtl1.Ink.Save(IPF_GIF, IPCM_NoCompression)
End Sub
[tab]Control : Command Button
[tab][tab]Name : Command6
[tab][tab]Caption : Load
Code:
Private Sub Command6_Click()
Dim v As Variant
Dim b() As Byte
Set v = Me.ActiveXCtl1
b = Me.InkData.Value
v.Ink.Load b
Set v = Nothing
End Sub
[/tt]

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Or:

create a table with an autonumber field and a field that contains the customer names.

then create a form and place an unbound image box on it.

put the code below in the 'on current' event of the form.

and store your signatures in a folder as bitmaps, name each signature the same as whatever is in the customer name field in the table.


Private Sub Form_Current()
'Display the current record number and the
Dim recPosition As Recordset
Dim filteredPosition As Recordset
'Dim CustomerRecordNum
Dim customername As String
Set recPosition = Me.RecordsetClone
Set filteredPosition = Me.RecordsetClone
recPosition.Bookmark = Me.Bookmark
recPosition.close
'=================================================================================================
filteredPosition.Bookmark = Me.Bookmark
customername = DLookup("[CustName]", "tblTableOfCustomers", "[CustNum] = " & (recPosition.AbsolutePosition + 1))
recPosition.close
'Image2 will be the name of the image box on your form
'R:\CustomersSignatures\ will be the path to the folder containing the signature files
Me.Image2.Picture = "R:\CustomersSignatures\" & customername & ".bmp"
Me.Repaint
End Sub



"Its not who you are that defines you, its what you do..." - Bruce Wayne
 
CautionMP This works awesome. Thank you so much. Now I am trying to do two things.

1. I want them to be able to say Oops and click the clear button to sign again. I can clear the value from the database field and close the form but it would be nice to clear the inkpicture with out closing the form.

2. How do you suggest I display it on a report? I put the inkpicture on the report and used the load code in the form load, detail format and it always gives me "You have entered an expression that has an invalid reference to the property |. This error occurs when v.Ink.Load is called.

Thanks
Thom
 
no1biscuit,
[ol][li]To clear the control [tt]Me.ActiveXCtl1.Ink.DeleteStrokes[/tt][/li]
[li]How to display in a report? I'm not sure.[/li][/ol]

I've never used the InkEdit control for a project, I've only ever played around with it. I will try some web searches and if I find a working solution I will post back.

CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
CautionMP,
I will try the DeleteStrokes. Thank you.

About the report. I am not wanting to do anything other than display the signature on a report. I don't want them to edit it.

Thanks again. I truly appreciate it.
Thom

 
The Deletstrokes kinda works. It appears to delete it but does not clear the inkpicture box but if I click off of it and/or do something for a while it will clear it out. I tried refresh/repaint/requery but just get errors.

Thanks again for all you have done. I am so close....
 
Since I could not get it to work on the reports then I tried mocking up a form that they could print with the signature but the inkpicture prints blank even though there is a signature in the box on the form. Any ideas?


Thanks again
Thom
 
Anyone else have any insight? This is killing me here....

Thanks
Thom
 
Still nothing from you all? I know you all have the answer but you wanted me to find out on my own. Good thinking...
 
HI No1biscuit,
I have the same problem but couldn't can it solve. So may I have a sample of this post. I'm very appriciated. Thanks for a millions.

TN (USA). I'm using Windows XP, Access 2003, Crystal Reports 11 and SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top