B
Bob Vance
My Combo Box cbGSTOptions selects either tax or no tax but after making my
selection I need to update with another control form the calculation to work
Control 2 is under the line====
Can I incorporate these two code to just the Afterupdate of my Combo Box
----------------------------------------------------------------------
Option Compare Database
Option Explicit
Dim recInvoice_ItMdt As ADODB.Recordset
Dim recInvoice As ADODB.Recordset, dblGSTContentsValue As Double,
lngIntermediateID As Long
Dim dblGSTOptionsValue As Double
Dim bModify As Boolean
Dim ynCheque As Boolean, lngInvoiceID As Long, strExpressionOrgument As
String
Dim sngGstPercentage As Single, recGSTOptions As ADODB.Recordset
Dim bLockFlag As Boolean
-------------------------------------------------------------------------------
Private Sub cbGSTOptions_AfterUpdate()
Set recGSTOptions = New ADODB.Recordset
recGSTOptions.Open "SELECT * FROM tblGSTOptions WHERE GSTOptionsText
LIKE '" _
& cbGSTOptions.value & "'", CurrentProject.Connection,
adOpenDynamic, adLockOptimistic
If recGSTOptions.EOF = True And recGSTOptions.BOF = True Then
MsgBox "Invalid GSTOption.", vbApplicationModal + vbInformation +
vbOKOnly
sngGstPercentage = Nz(recGSTOptions.Fields("GSTPercentage"), 0)
tbRate.value = sngGstPercentage
tbRate2.value = sngGstPercentage
'============================================================
bModify = True
cmdCalculate.Enabled = True
cbGSTOptions.Enabled = True
cmdCalculate.SetFocus
cmdModify.Enabled = False
Forms!frmMain!lstModify.Requery
End If
End Sub
selection I need to update with another control form the calculation to work
Control 2 is under the line====
Can I incorporate these two code to just the Afterupdate of my Combo Box
----------------------------------------------------------------------
Option Compare Database
Option Explicit
Dim recInvoice_ItMdt As ADODB.Recordset
Dim recInvoice As ADODB.Recordset, dblGSTContentsValue As Double,
lngIntermediateID As Long
Dim dblGSTOptionsValue As Double
Dim bModify As Boolean
Dim ynCheque As Boolean, lngInvoiceID As Long, strExpressionOrgument As
String
Dim sngGstPercentage As Single, recGSTOptions As ADODB.Recordset
Dim bLockFlag As Boolean
-------------------------------------------------------------------------------
Private Sub cbGSTOptions_AfterUpdate()
Set recGSTOptions = New ADODB.Recordset
recGSTOptions.Open "SELECT * FROM tblGSTOptions WHERE GSTOptionsText
LIKE '" _
& cbGSTOptions.value & "'", CurrentProject.Connection,
adOpenDynamic, adLockOptimistic
If recGSTOptions.EOF = True And recGSTOptions.BOF = True Then
MsgBox "Invalid GSTOption.", vbApplicationModal + vbInformation +
vbOKOnly
sngGstPercentage = Nz(recGSTOptions.Fields("GSTPercentage"), 0)
tbRate.value = sngGstPercentage
tbRate2.value = sngGstPercentage
'============================================================
bModify = True
cmdCalculate.Enabled = True
cbGSTOptions.Enabled = True
cmdCalculate.SetFocus
cmdModify.Enabled = False
Forms!frmMain!lstModify.Requery
End If
End Sub