N
NathanG
Hi,
Using a .adp file a form retrieves data based on the selected criteria in
drop down boxes on a form. This is the code
Set rst = cn.Execute("select * from BudgetFISWorkingData where CostCentre =
'" & cmbCostCentre.Value & "' and Accounts = '" & cmbAccounts.Value & "S' and
Scenarios = '" & gstrSelectedScenario & "' and Versions = '" &
gstrSelectedVersion & "' and Years = '" & cmbYears.Value & "'")
What it is doing is setting the record set (rst) to whatever the year,
scenario, version, account and costcentre is. You can see that for " &
cmbAccounts.Value & "S' there is the 'S' on the end. What is happeninf is
that the accounts with an 'S' on the end are not being retrieved. An account
is passed i.e. A1000 but it the criteria should force the where clause to
find 'A1000S'. It doesn't. It just finds A1000 which has no values and
returns zeros if
If rst.EOF Then
txtStatJan = 0
etc etc
How can a character be correctly added in VBA? I have tried different things
but I get a syntax or debug error.
Thanks,
Nathan
Using a .adp file a form retrieves data based on the selected criteria in
drop down boxes on a form. This is the code
Set rst = cn.Execute("select * from BudgetFISWorkingData where CostCentre =
'" & cmbCostCentre.Value & "' and Accounts = '" & cmbAccounts.Value & "S' and
Scenarios = '" & gstrSelectedScenario & "' and Versions = '" &
gstrSelectedVersion & "' and Years = '" & cmbYears.Value & "'")
What it is doing is setting the record set (rst) to whatever the year,
scenario, version, account and costcentre is. You can see that for " &
cmbAccounts.Value & "S' there is the 'S' on the end. What is happeninf is
that the accounts with an 'S' on the end are not being retrieved. An account
is passed i.e. A1000 but it the criteria should force the where clause to
find 'A1000S'. It doesn't. It just finds A1000 which has no values and
returns zeros if
If rst.EOF Then
txtStatJan = 0
etc etc
How can a character be correctly added in VBA? I have tried different things
but I get a syntax or debug error.
Thanks,
Nathan