Using Access VBA code to copy between unbound- and bound fields

mardi 21 avril 2015

I have 2 fields in an MS Access form "BTKForm" sending and picking up data form a bank terminal.
Code is executed by clicking a Button on the form.

Field 1, "IssuerID", is an Unbound field picking up a code from the bank terminal. It's numbers between 0 and 100, representing the Card provider.

Field 2 - "IsID", is a value field linked to a table.

I want to take care of (save) (copy) "IssuerID" in to "IsID".

I have been struggling with the problem for a long time.
Nobody have so far been able to help me.
Please, can somebody help? :banghead:

Code is:
Code:


 Public Sub TransferAmount_Click()
Set BAX = CreateObject("BankAxeptSrv.BankAxeptAutomation")
If BAX.Connected And BAX.LicenseVerified And Not BAX.BankMode Then
Dim amnt As Long
Dim cashb As Long
amnt = Round(Amount.Value * 100)
cashb = Round(Cashback.Value * 100)
If BAX.TransferAmount(amnt, cashb) Then
While BAX.BankMode
While BAX.GetNoOfDisplayMsgs > 0
DisplayMsgs.SetFocus
DisplayMsgs.AddItem (BAX.GetDisplayMsg)
DoEvents
Wend
DoEvents
Wend
While BAX.GetNoOfPrinterMsgs > 0
PrinterMsgs.SetFocus
PrinterMsgs.AddItem (BAX.GetPrinterMsg)
DoEvents
Wend
If BAX.TransactionOK Then
TransactionStatus.SetFocus
TransactionStatus.AddItem ("OK")
IssuerID.SetFocus
IssuerID.AddItem (Str(BAX.GetIssuerID)) ' Getting IssuerID from bank terminal.
Dim lPauseTime As Long
Dim lStart As Long
lPauseTime = 3 'Seconds
lStart = Timer
Do While Timer < lStart + lPauseTime
DoEvents
Loop
Me.IsID = Me.IssuerID
DoCmd.RunMacro "Auto A kort" 'Closes the Form and printing a Check.
Else
TransactionStatus.SetFocus
TransactionStatus.AddItem ("AVVIST")
IssuerID.SetFocus
IssuerID.AddItem ("99")
DoCmd.RunMacro "Avvist 2.BTKForm" 'what is done if tranaction is dismissed.
End If
End If
End If
End Sub

 


Using Access VBA code to copy between unbound- and bound fields

0 commentaires:

Enregistrer un commentaire

Labels