G
Guest
Hi,
I am attempting to split a part an account code to extract part of it, and
some great people here have given me some code to aid in this endeavor. (I
have now read a few chapters about Visual Basic), however I am encountering
the following error:
Run-time Error '13':
Type Mismatch
The Accounting_Code in my table has a Text datatype.
VB Procedure:
Public Function Extract(Account_Code As String) As String
Dim Tokens() As String
Tokens = Split(Account_Code, ".", -1)
Extract = Mid(Tokens, 4, 4)
End Function
Update Query:
UPDATE SUB_1 SET SUB_1.Clearing_Account = Extract([Clearing_Account]);
Visual Basic Editor is highlighting the "Extract = Mid(Tokens, 4, 4)" line
of code from my procedure, but as far as I know everything is setup as text
so there should not be a problem. ???
Thanks for your time,
David
I am attempting to split a part an account code to extract part of it, and
some great people here have given me some code to aid in this endeavor. (I
have now read a few chapters about Visual Basic), however I am encountering
the following error:
Run-time Error '13':
Type Mismatch
The Accounting_Code in my table has a Text datatype.
VB Procedure:
Public Function Extract(Account_Code As String) As String
Dim Tokens() As String
Tokens = Split(Account_Code, ".", -1)
Extract = Mid(Tokens, 4, 4)
End Function
Update Query:
UPDATE SUB_1 SET SUB_1.Clearing_Account = Extract([Clearing_Account]);
Visual Basic Editor is highlighting the "Extract = Mid(Tokens, 4, 4)" line
of code from my procedure, but as far as I know everything is setup as text
so there should not be a problem. ???
Thanks for your time,
David