Talismanic
Registered User.
- Local time
- Today, 23:20
- Joined
- May 25, 2000
- Messages
- 377
Is it possible to add a - to the end of a entered record in a control so that if the user tyes K756 the record would be instantly changed to K756- ?
I know that I could concantenate it with a & but I have a before update that checks for valid numbers that is causing me problems when I try it. Here is the code:
Private Sub JobNumber_BeforeUpdate(Cancel As Integer)
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
Dim Answer As Variant
If DCount("[jobname]", "JobNumbers", "[JobNumber]= '" _
& Me!JobNumber & "'") = 0 Then
strMsg = "Please try a different number"
strTitle = "Invalid Job Number"
intStyle = vbOKCancel + vbInformation
Answer = MsgBox(strMsg, intStyle, strTitle)
If Answer = vbCancel Then Exit Sub
Cancel = True
End If
JobName = DLookup("[jobname]", "jobnumbers", "[jobnumber]= '" _
& Me!JobNumber & "'")
End Sub
[This message has been edited by Talismanic (edited 11-30-2000).]
I know that I could concantenate it with a & but I have a before update that checks for valid numbers that is causing me problems when I try it. Here is the code:
Private Sub JobNumber_BeforeUpdate(Cancel As Integer)
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
Dim Answer As Variant
If DCount("[jobname]", "JobNumbers", "[JobNumber]= '" _
& Me!JobNumber & "'") = 0 Then
strMsg = "Please try a different number"
strTitle = "Invalid Job Number"
intStyle = vbOKCancel + vbInformation
Answer = MsgBox(strMsg, intStyle, strTitle)
If Answer = vbCancel Then Exit Sub
Cancel = True
End If
JobName = DLookup("[jobname]", "jobnumbers", "[jobnumber]= '" _
& Me!JobNumber & "'")
End Sub
[This message has been edited by Talismanic (edited 11-30-2000).]