Update Textbox Contents

B

Bob M.

I am using Access 2003 to build a Point of Sale and inventory control
application. When I Swipe the Credit Card A long string is returned that has
to be parsed for pertinent information. I can parse the information I need
with no problem.

I want to put some of this information in textboxes on the form. When I try
to populate a textbox I get "Run-time error 2115"
The macro or function set to the BeforeUpdate or Validation Rule property for
this field is preventing Convention POS from saving the field. There are no
BeforeUpdate or ValidationRules set for these boxes.

The text box is unbound.

Can anyone help me?

Thanks.
 
O

OldPro

I am using Access 2003 to build a Point of Sale and inventory control
application. When I Swipe the Credit Card A long string is returned that has
to be parsed for pertinent information. I can parse the information I need
with no problem.

I want to put some of this information in textboxes on the form. When I try
to populate a textbox I get "Run-time error 2115"
The macro or function set to the BeforeUpdate or Validation Rule property for
this field is preventing Convention POS from saving the field. There are no
BeforeUpdate or ValidationRules set for these boxes.

The text box is unbound.

Can anyone help me?

Thanks.

Is there formatting set on any of the text boxes? Can you find the
exact textbox and the exact string that is causing the problem?
 
B

Bob M.

This is the Parseing Function I am using:


Public Function GetParseData(TrackData As String)


'TrackData=%B500100060002000^DOE/BOB J
'^070110100000033402000000848000000?;500100060002000=0701101334020848'?

The string is from scanning a Credit Card. I need to extrack the Name,
Expiration Date and Account Number from the string. The parsing works good.

Dim CardRead As String
Dim ExpDate As String
Dim Name As String
Dim Card As String
Dim Track1 As String
Dim Track2 As String
Dim Tra1BS As Integer
Dim Tra1ES As Integer
Dim Tra2BS As Integer
Dim Tra2Es As Integer
Dim NameStart As Integer
Dim NameEnd As Integer
Dim Eq As Integer
Dim expM As String
Dim ExpY As String
Dim Tracks As Integer
Dim CardIsSwiped As Boolean





Dim MemberLength AccountNumberLength As Integer
Dim AccountNumber, CurrentCharacter, FirstCharacter As String

CardRead = Trim(TrackData)
FirstCharacter = Left(CardRead, 1)

If FirstCharacter = "%" Then 'first character of Track I is %; first
character of Track II is ?
CardIsSwiped = True
Tracks = 2
End If




If Tracks = 2 Then 'Both tracks have been read

'calculate lengths of Track I & 2
Tra1BS = InStr(CardRead, "%") 'Beginning of Track 1
Tra1ES = InStr(CardRead, "?") 'End of Track 1
Tra2BS = InStr(CardRead, ";") 'Beginning of Track 2
Tra2Es = InStr(Tra2BS, CardRead, "?") 'End of Track
'Calculate positin of Name
NameStart = InStr(CardRead, "^")
NameEnd = InStr(NameStart + 1, CardRead, "^")
AccountNumberLength = NameStart - 3
AccountNumber = Mid(CardRead, 3, AccountNumberLength)
MemberLength = NameEnd - (NameStart + 1)
Name = Mid(CardRead, NameStart + 1, MemberLength)
Trim (Name)
'If MemberLength > 20 Then
'MemberLength = 20
'End If


Forms!frmConvOrdMast!Expiration.SetFocus
* Forms!frmConvOrdMast!Expiration.Text = Mid(CardRead, NameEnd + 3,
2) + Mid(CardRead, NameEnd + 1, 2)
Forms!frmConvOrdMast!Expiration.ReleaseFocus
Forms!frmConvOrdMast!CreditCardNo.SetFocus
Forms!frmConvOrdMast!CreditCardNo.Text = ""
* Forms!frmConvOrdMast!CreditCardNo.Text = AccountNumber
Forms!frmConvOrdMast!CreditCardNo.ReleaseFocus
Forms!frmConvOrdMast!CardHolder.SetFocus
* Forms!frmConvOrdMast!CardHolder.Text = Name
Forms!frmConvOrdMast!CardHolder.ReleaseFocus
Tracks = 0
Forms!frmConvOrdMast!azOrdTotalAmt.SetFocus

CardRead = ""
End If

End Function

There is no formatting applied to any of the three text boxes. The run-time
error occurs regardless of what order I try to populate the textboxes, but
alway the first one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top