Senin, 20 Agustus 2012

[MS_AccessPros] Need help with Error Trapping in vba

 

Hello all,

I have a form that is taking a scan from a card from the black strip side. I have that working great. But if the user tries to use the gold strip side, there are different numbers that we do not want. It is bank information that means nothing to us. We only need 29 characters of the black strip so my code reflects that. The gold strip has more than 30 characters. But I cannot figure out how to have some validation to give a message when the user slides the gold side of the card.

Can anyone take a look and give me some help.

Thank You

Jim Wagner

Private Sub SID_Change()

If Len(Me.SID.Text) = 29 Then
If Me.Dirty Then Me.Dirty = False

'Private Sub SID_AfterUpdate()
'If Len(Me.SID.Text) > 30 Then
'lblstep.Visible = True
'lblstep.Caption = "Please slide black strip side."
'
End If
'End Sub

'Else

'If Me.Dirty Then Me.Dirty = False

lblstep.Visible = True
lblstep.Caption = "Step 2: Please step on the scale until this message disappears..."
'End If

SID.ForeColor = vbWhite

Dim PauseTime, Start
PauseTime = 9
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop

DoCmd.GoToRecord acForm, "Suncard", acNewRec
lblstep.Visible = False

DoCmd.RunMacro "Macro1"

DoCmd.OutputTo acOutputTable, "Archive", _
acFormatXLS, "Barrett.xls", False

End Sub

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar