Search results

  1. G

    Option Frame: Get Name and Tag text

    Does anyone know the syntax to get the Option Name, and the Option Button Tag, from the selected option in an Option Group ?
  2. G

    User Defined Function in SQL Select

    You're right the parts are moving as I continue to develop it. The form is my most complex one with two datasheets, each one a view on to a different table and they must be kept in sync to work. Appreciate the help, and you've mentioned posting a db. Do you mean the whole thing ? It has...
  3. G

    User Defined Function in SQL Select

    Yes bCredit is boolean within frmPayment only fDocSign is due for revision. tblDocTypes is being developed but here's the current lookup Public Function fDocSign(strDocType As String) As Boolean Dim db As Database Dim rec As DAO.Recordset Set db = CurrentDb Set rec =...
  4. G

    User Defined Function in SQL Select

    See post #1. txtSalePrice = fSign(bCredit(tlSalePrice)) Where fSign returns the value negated if bCredit is true, it's a public function Where does bCredit come from ? thDocType is the form record, it's a table field for the record that the form is opened with function fDocSign will...
  5. G

    User Defined Function in SQL Select

    OK, sorry yes I'm not explaining myself, Supplier Invoice or Customer Invoice are effectively set by bCredit. It's the same thing really. Likewise Supplier Payment or Customer Receipt are effectively set by bCredit. The iif is perfect sense except I hadn't thought of using it like that. So...
  6. G

    User Defined Function in SQL Select

    bCredit is a main form module boolean set after the two sub forms have loaded. There's a representation of it on the form, the box with the word 'credit' in it, that's just so I know what's going on during development I was originally asking about the payment side, where tlSalePrice (a table...
  7. G

    User Defined Function in SQL Select

    I think a screenshot will be more use than some partly developed code. I thought I had it cracked with the -1 multiply but it's not a complete solution. The form will do what I want it to, it's all about presentation and shielding the user from negative values when they don't expect to see them...
  8. G

    User Defined Function in SQL Select

    bCredit is a boolean evaluated in frmPayment (which is also going to do receipts) So from an index form, user selects a document which could be 'Purchase Payment' or 'Sales Receipt'. Document type is passed in OpenArgs. frmPayment opens. Reads OpenArgs, then goes to a config table and finds...
  9. G

    User Defined Function in SQL Select

    Thanks Colin, I'm not sure that it's the answer. It would be good to know if there's a solution although I'll go with my multiply by -1 method. Because it works well with a dual function invoice form, it edits a sales invoice or a purchase invoice, the user keys positive unsigned values on...
  10. G

    User Defined Function in SQL Select

    I realise I can reference main form stuff from the sub form. Sorry to keep saying it, I must be misunderstanding the working of Access (very likely) but main form or bCredit isn't available when the sub form loads. I realise I can 'late bind' when the main form loads, that's the aim, but...
  11. G

    User Defined Function in SQL Select

    Because it's not available when the sub form loads, it's evaluated in the main form. Sub forms always load first, don't they? Hence the reason I cut the recordsource out of the sub form and into the main form. Is it possible to put a user-defined function *within* a SQL select ? Like post...
  12. G

    User Defined Function in SQL Select

    Not sure how I can explain it better. The bottom line is I want to optionally negate one of the SQL select fields before it's displayed in the datasheet. I don't want to change the value (not yet anyway), I want to display it reversed. Not ABS, not necessarily positive, I want to display it...
  13. G

    User Defined Function in SQL Select

    Yes quite possibly. The user would edit txtSalePrice. Then I would negate it in BeforeUpdate and assign it to tlSalePrice. It's a payment form which I want to serve as a receipts form. But users don't expect to have to key payments as minus values (as in, credit bank account: book...
  14. G

    User Defined Function in SQL Select

    PS I can't use ABS or negate it regardless, the whole point is that I want to see the reversed value according to bCredit. Sometimes the table value might actually be 234.56 and I would want to see that as 234.56-
  15. G

    User Defined Function in SQL Select

    OK thanks DB Guy, I've bound txtSalePrice to tlSalePrice but I get (as I expected) the 'naked' value of tlSalePrice appearing. So I can now see £234.56- but I want it to appear as £234.56 The table value of tlSalePrice is 234.56-, I don't want to change it in this routine, I just want it to...
  16. G

    User Defined Function in SQL Select

    field txtSalePrice is unbound with no data source field tlSalePrice is the table field the sub form has no data source (until it's bound in the main form) When the SQL query runs, the sub form is already loaded. The datasheet fills with data, but the unbound field txtSalePrice is empty. So I...
  17. G

    User Defined Function in SQL Select

    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...
  18. G

    Erratic Tab control Tab Tag Property

    And that did it ! Wish I'd asked sooner. Thanks so much. Might have another question coming up about how to drop that result in a query / file name string, I'll see how it goes
  19. G

    Erratic Tab control Tab Tag Property

    There's not a lot of info out there about how to get the tab tag name so my construct was a guess really after using AutoFill to get the right controls. the line Select Case Me.TabCtlIndexes.value is what I've had in all along, each case select has some repetitive code but I need to put a...
  20. G

    Erratic Tab control Tab Tag Property

    OK struggling to get this one fixed. A tab control with 6 pages. Ordinally numbered from 0 of course. The OnChange event has a big ugly CASE select with some code that could be massively streamlined, but I need to get a value from each tab then drop it in a few places. So I put some text in...
Back
Top Bottom