Brain Dump on code

  • Thread starter Thread starter tomrector
  • Start date Start date
T

tomrector

I am having a problem today;
I have this code in "Before Update" on form field ftxtCCard

Public Function CCVSModuleWindowCCNumberTester()
Dim CCVSAnswer As Boolean
Dim Number As String
Number = InputBox("Enter a Credit Card Number", "Enter a Number")
CCVSAnswer = CCValidationSolution(Number)
If CCVSAnswer = True Then
Number = OnlyNumericSolution(Number)
MsgBox Number & " is a valid number.", vbInformation, "Test
Result:"
End If
End Function

My actual credit card field name is ftxtCCard
I want to change from an "InputBox - and have the data I just put in
ftxtCCard pushed to Number.

This code is from
http://www.analysisandsolutions.com/software/ccvs/ccvs-vb.htm

Thanks for any help

Tom Rector
(e-mail address removed)
 
Since this is a public function I assume it's in a module, so you would need
to pass in the number. Also, since it doesn't return anything, it might as
well be a subroutine rather than a function:

Public Sub CCVSModuleWindowCCNumberTester(ByRef Number As String)
Dim CCVSAnswer As Boolean
CCVSAnswer = CCValidationSolution(Number)
If CCVSAnswer = True Then
Number = OnlyNumericSolution(Number)
MsgBox Number & " is a valid number.", vbInformation, "Test
Result:"
End If
End Sub

Call it from your BeforeUpdate event thus:

CCVSModuleWindowCCNumberTester Me.ftxtCCard
 
Thanks Baz,
I'm in business !
Don't know what I was thinking,

Can move forward now ...
 
No worries, I get more and more of these grey matter malfunctions as I get
older...
 

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

Back
Top