I'm using the record set to get the banking details to be part of the invoice instead of Dlook up but the loading of invoices is slow causing clients to wait for some time which I feel is bad for the business, could you please assist on how to improve the speed. if I remove the banking details the invoice becomes faster any idea how to sort put this?
Parameters not working below
The code below is suppose to use parameters to select only one record at a time but its updating the entire record in the table any Idea here how to stop this
Below is a pass through updatate which attach to the above query
Code:
Private Sub Report_Load()
Dim db As DAO.Database
Dim strSQL As String
Dim prm As DAO.Parameter
Set db = CurrentDb
strSQL = "SELECT CompanyName,Address,Town,VATRegistration,Country,AccountName,BankName,AccounNumber,BranchName,SortCode,SWIFTCODE,ContactPerson," & _
"ContactTelephone,ContactEmail FROM [tblCompany] WHERE [CompID] = 1"
With db.CreateQueryDef("", strSQL)
For Each prm In .Parameters
prm.Value = Eval(prm.Name)
Next
With .OpenRecordset(dbOpenSnapshot, dbSeeChanges)
If Not .EOF() Then
Me.txtCompanyName = .Fields(0).Value
Me.txtAddress = .Fields(1).Value
Me.txttown = .Fields(2).Value
Me.txtTpins = .Fields(3).Value
Me.txtcontinent = .Fields(4).Value
Me.txtAccountNumber = .Fields(7).Value
Me.txtBranch = .Fields(8).Value
Me.txtSortCode = .Fields(9).Value
Me.txtSwiftCode = .Fields(10).Value
Me.txtttCompanyName = .Fields(0).Value
Me.txtBankNames = .Fields(6).Value
End If
End With
End With
Set prm = Nothing
Set db = Nothing
If (Me.txtgames = 0) Then
Me.txtgames.Visible = False
End If
End Sub
Parameters not working below
The code below is suppose to use parameters to select only one record at a time but its updating the entire record in the table any Idea here how to stop this
Code:
Private Sub CmdPostJvs_Click()
Dim SCh As String
Dim Cancel As Integer
If (((DSum("Dr", "tblVoucher", "[CreateID] =" & Me.CboCreateID)) - (DSum("Cr", "tblVoucher", "[CreateID] =" & Me.CboCreateID))) <> 0) Then
Cancel = True
MsgBox "Please note that your Journal is out of balance", vbExclamation, "Check both debits and credits are not equal"
Exit Sub
End If
If IsNull(Me.CboCreateID) Then
MsgBox "Please Select the journal to post", vbInformation, "Post Financial Journal"
Me.CboCreateID.SetFocus
Exit Sub
ElseIf IsNull(Me.Cbostatus) Then
MsgBox "Please Select Approved to post", vbInformation, "Post Financial Journal"
Me.Cbostatus.SetFocus
Exit Sub
End If
If (Me.txtbalance <> 0) Then
MsgBox "Please Check And Clear The Difference In The Box Below", vbInformation, "Post Financial Journal"
Cancel = True
Me.CboCreateID = Null
Me.Cbostatus = Null
Exit Sub
ElseIf (Me.txtbalance = 0) Then
Cancel = False
End If
Dim db As DAO.Database
Dim strSQL As String
Dim strSqLOne As String
Set db = CurrentDb
strSQL = "SELECT * FROM [QryJournals] WHERE [tblJournalHeader].[CreateID] = " & [Forms]![FrmJournalVourcherPosting]![CboCreateID]
DoCmd.SetWarnings False
DoCmd.OpenQuery "QryJournals"
strSqLOne = "SELECT * FROM [QryFinJournal] WHERE [tblJournalHeader].[CreateID] = " & [Forms]![FrmJournalVourcherPosting]![CboCreateID]
DoCmd.SetWarnings False
DoCmd.OpenQuery "QryFinJournal"
db.Close
Set db = Nothing
MsgBox "Journal Posting successful", vbInformation, "Please Proceed"
Me.CboCreateID.Requery
Me.CboCreateID = Null
Me.Cbostatus.Requery
Me.Cbostatus = Null
End Sub
Below is a pass through updatate which attach to the above query
Code:
UPDATE tblJournalHeader SET tblJournalHeader.Status = '1';