GK in the UK
Registered User.
- Local time
- Today, 16:28
- Joined
- Dec 20, 2017
- Messages
- 281
As an enhancement to an existing form I need to bind its recordsource with a SQL select in code, because I need to optionally display one of the columns negated and the criteria for that isn't available when the sub form loads.
So, I deleted the recordsource SQL in the data source for the sub form, and put it in the main form code.
The sub form has a field, txtSalePrice, which is the (optionally) negated value of the bound field tlSalePrice.
In the SQL select in the main form code one of the selections reads:
tblTransLines.tlSalePrice AS txtSalePrice
But nothing displays in the field txtSalePrice.
So that's one issue, but I also need to insert a function into the SQL select to display it 'as is' or negated.
So somehow I need to insert this function into the SQL select in the main form code.
txtSalePrice = fSign(bCredit(tlSalePrice))
Where fSign returns the value negated if bCredit is true
So that when the datasheet is bound it displays the value of tlSalePrice negated (for one or many lines)
Can it be done ?
So, I deleted the recordsource SQL in the data source for the sub form, and put it in the main form code.
The sub form has a field, txtSalePrice, which is the (optionally) negated value of the bound field tlSalePrice.
In the SQL select in the main form code one of the selections reads:
tblTransLines.tlSalePrice AS txtSalePrice
But nothing displays in the field txtSalePrice.
So that's one issue, but I also need to insert a function into the SQL select to display it 'as is' or negated.
So somehow I need to insert this function into the SQL select in the main form code.
txtSalePrice = fSign(bCredit(tlSalePrice))
Where fSign returns the value negated if bCredit is true
So that when the datasheet is bound it displays the value of tlSalePrice negated (for one or many lines)
Can it be done ?