Search results

  1. Ken Sheridan

    Solved Need help with number as text

    I had a look at how I might enter dimensions in feet and inches if the need ever arose. Data entry is simple of course, as parsing feet, inches, and fractions of inches into a single decimal value in inches is easily done. Reversing the process to convert a decimal value in whole feet and...
  2. Ken Sheridan

    Solved Need help with number as text

    I wouldn't be too worried about a value like that in a narrative long text column. My partner tells me we did in fact do so in a database of enslaved persons we built for a museum in the US. I'd still like to know how Americans (and whoever else still uses imperial units) enter dimensions as...
  3. Ken Sheridan

    Solved Need help with number as text

    I entirely agree that the use of a bound form is a no brainer. As regards feet and inches, I do have to put up with them from my American partner. I don't think she'll ever get used to metric units! When entering dimensions or quantities I'd generally include a Unit column, which might have...
  4. Ken Sheridan

    Solved Age calculatoion Function

    Doh! Public Function GetAge(varDoB As Variant, blnFebLeapAnniversary As Boolean, Optional varAgeAt As Variant) As Variant ' Returns: Age in years as an integer. ' Accepts: varDoB; date/time value ' blnFebLeapAnniversary; Boolean constant, TRUE if anniversary '...
  5. Ken Sheridan

    Solved Need help with number as text

    You could do this more concisely by executing a single SQL INSERT INTO statement with a VALUES clause. You can then rely on a key violation to determine any attempt at inadvertent duplication. The SQL statement would be executed with the dbFailOnError constant, and the error handled in the...
  6. Ken Sheridan

    Solved Age calculatoion Function

    Try the following functions. I've amended the line which sets the return value of the first function, so that it suppresses the zero if the return value is less than one year: Public Function GetAgeYearsMonths(varDoB As Variant, Optional varAgeAt As Variant) As Variant Dim intYears As...
  7. Ken Sheridan

    Help Please

    As I understand it from your earlier posts, the loyalty amount is set for each customer when they open an account. It is an attribute of the Customers entity type, so you just have to look it up from the Customers or similar table, in which the Barcode column will be a candidate key. The...
  8. Ken Sheridan

    Help Please

    I don't see what the problem is I'm afraid. Surely you simply need to update the customer's bonus balance with simple arithmetical expressions like those I described when you scan their barcode. The only other factor is whether you credit a customer with a bonus amount when only a part of the...
  9. Ken Sheridan

    Help Please

    The arithmetic is very simple. With your example the balance after buying a $15 beer would be: CurrentBalance + AmountDue - Price, i.e. 12 + 3 - 15 = 0. If they'd bought a $10 beer the balance would, using the same expression: 12 + 0 - 10 = 2. So computing the balance after each purchase...
  10. Ken Sheridan

    Problem with sql syntax with JOIN and WHERE in vba

    Many of the things we call numbers are not really numbers, in that they have no ordinal or cardinal significance. In many cases they are really encoding systems. ISBN and Zip codes are examples. These should be stored in a column of Short Text data type therefore. In expressions such values...
  11. Ken Sheridan

    The copy text and add new record Button Events are not working

    The code in the K button's Click event procedure in itself looks OK, but it's execution is conditional on the value of the unbound cboSymbolStock control in the form header. This control's RowSource property references two columns, PortfolioCode and Sergey, which don't exist in the...
  12. Ken Sheridan

    The copy text and add new record Button Events are not working

    No luck again I'm afraid. Are you using the Attach files button at the bottom of the reply window to attach your file?
  13. Ken Sheridan

    The copy text and add new record Button Events are not working

    No file was attached to your last post. Looking back at the error messages you received, the wording is not what I'd expect if the key or another unique index is being violated, so I'm wondering if you have some a custom error handling procedure. Try posting the file again.
  14. Ken Sheridan

    The copy text and add new record Button Events are not working

    The error you are experiencing suggests that something in the current record is violating a unique index. This could be duplication of the primary key value(s), or of value(s) in another uniquely indexed column or columns. This prevents the record being saved, which in turn prevents the form...
  15. Ken Sheridan

    Linked tables don't appear to be

    You can see the current trusted locations from Access with File | Options | Trust Center | Trust Center Settings | Trusted Locations. It is likely that your Documents folder and its sub-folders are set as trusted locations, which is why you were able to open the file once you'd moved it to there.
  16. Ken Sheridan

    Crosstab query that uses Form field as criteria

    The code you've used is the standard solution when you need to return a recordset based on a query which includes parameters. I've used it many times myself. As regards your second issue, the approach I would use in cases like that would not be to include parameters in the query, but when...
  17. Ken Sheridan

    Has anyone tried opening a Mail Merging Word Document through Access VBA?

    I've been distributing the following function, along with other Access to Word automation routines, for the last 25 years or so. It's always been well received. Note that the function creates a temporary text file as the data source for the merge, rather than using the original query. Public...
  18. Ken Sheridan

    Linked tables don't appear to be

    I don't know why that should be. Have you placed the .accdb files in a Trusted Location? The code for the opening form's Open event procedure, which validates the current links, is: Private Sub Form_Open(Cancel As Integer) On Error GoTo Err_Handler Const conFILENOTFOUND = 3024...
  19. Ken Sheridan

    The printer does not cut on each record

    To force a new page after the group you'll need to add a group footer section, which can be of zero height, and set the Force New Page property of the footer to 'after section'.
  20. Ken Sheridan

    Service Ticket Table(s)

    As has been pointed out by others, the process of normalization is crucial to the design of tables in a relational database. To understand normalization it is firstly necessary to have a good understanding of the concept of functional determination, which is the basis of the principles on which...
Back
Top Bottom