M
Mike Hudson
I have created a custom form. Code as follows:
(Messy I know, but it does the job)
Function Item_Open()
'Error Handler
on error resume next
Dim jobid
'Seed random number generator
Randomize
Jobid = "Unique Job ID:#!# " & Int((99999 * Rnd) + 1)
'Check to see if item already has this.
mypos = InStr(1, Item.body, "#!#")
'If not then stick it on
If mypos < 1 Then
item.body = item.body & vbcrlf & _
vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & _
"Start Time: ......................... End Time: ........................." & vbrlf & _
vbcrlf & vbcrlf & "Date: ..................................." & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & _
"Please get the customer to complete the following details on job completion:" & vbcrlf & _
"Signature: Print Name:" & vbcrlf & vbcrlf & vbcrlf & _
"......................... .........................." & vbcrlf & _
vbcrlf & vbcrlf & "Engineers Name: ............................." & vbcrlf & "Assigned By: " & item.owner & vbcrlf & vbcrlf & _
vbcrlf & "Explanation of how " &_
"the issue was resolved: (Any parts used etc)" & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & _
vbcrlf & vbcrlf & "Added @ " & Now() & vbcrlf & "By: " & Item.owner & vbcrlf & _
jobid
'Item.Update
End If
End Function
Function Item_Close()
mypos = instr(1, item.subject, "#!#")
If MyPos < 1 Then
Item.subject = item.subject & " " & jobid
End If
End Function
This is on a task form in a public folder.
When I try and run this form I get:
"Can't open this item"
any ideas?
(Messy I know, but it does the job)
Function Item_Open()
'Error Handler
on error resume next
Dim jobid
'Seed random number generator
Randomize
Jobid = "Unique Job ID:#!# " & Int((99999 * Rnd) + 1)
'Check to see if item already has this.
mypos = InStr(1, Item.body, "#!#")
'If not then stick it on
If mypos < 1 Then
item.body = item.body & vbcrlf & _
vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & _
"Start Time: ......................... End Time: ........................." & vbrlf & _
vbcrlf & vbcrlf & "Date: ..................................." & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & _
"Please get the customer to complete the following details on job completion:" & vbcrlf & _
"Signature: Print Name:" & vbcrlf & vbcrlf & vbcrlf & _
"......................... .........................." & vbcrlf & _
vbcrlf & vbcrlf & "Engineers Name: ............................." & vbcrlf & "Assigned By: " & item.owner & vbcrlf & vbcrlf & _
vbcrlf & "Explanation of how " &_
"the issue was resolved: (Any parts used etc)" & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & vbcrlf & _
vbcrlf & vbcrlf & "Added @ " & Now() & vbcrlf & "By: " & Item.owner & vbcrlf & _
jobid
'Item.Update
End If
End Function
Function Item_Close()
mypos = instr(1, item.subject, "#!#")
If MyPos < 1 Then
Item.subject = item.subject & " " & jobid
End If
End Function
This is on a task form in a public folder.
When I try and run this form I get:
"Can't open this item"
any ideas?