Search results

  1. T

    Precision of numeric data stored in variant

    How is numeric data stored in variant data types? It seems that numbers in variant data types don't respond well to high-precision calculations. I had the calculation (data types as in the names): dblX = varY - dblZand I had a case when: varY = 0 dblZ = 0.0000000121But dblX returned 0, not...
  2. T

    Cancel form navigation event

    Hi, is there any way to cancel navigation to a different record? I want to make sure that a subform has exactly one record before allowing the user to move away from the current record or close the form, and cancel the close/navigation if necessary. The close event was easy enough, but I can't...
  3. T

    SQL INSERT INTO Date Syntax Error

    I'm trying to run the following SQL (PropertyID is Double, TimeStamp is Date/Time) but the TimeStamp part is causing a syntax error (Runtime error 3134) - am I missing something? DoCmd.RunSQL "INSERT INTO tblProperties (PropertyID, TimeStamp) VALUES (1, #07/08/2010 06:37:43#)"I've also tried...
  4. T

    Duplicating records

    Hi, I want to write a sub to duplicate a record in any table, i.e., the only parameters are the table name and sql criteria like so: DuplicateFunc(strTableName As String, strSQLCriteria As String). I've started by using "INSERT INTO" statements but that requires knowing the number of fields of...
  5. T

    Table structuring

    Thanks for your responses - I'll have a good think about your suggestions and get back to you. But the first question that pops up is what about different data types? You both suggest methods that tries to avoid the creation of new fields (or tables) for new types of properties, but what if I...
  6. T

    Table structuring

    I have a lot of structures in my database like so: Consider inventory - I might have stocks of balloons, for which I need to record colour, or I might have stocks of cars for which I need to record their registration plate numbers, and so on. The point is, I will need to record different...
  7. T

    VBE capitalising "p" on new line

    Hi, anyone else notice that if you type "p" on a new line, VBE capitalises the first letter? Any way to switch this off? Thanks
  8. T

    Split form variables not retaining value

    Thanks - I mean in all events that originate from the datasheet part of the split form fails to retain module-wide variables - i.e. if I have a hyperlink set on field Field1, something simple like this would fail to give the desired result: Option Compare Database Option Explicit Private...
  9. T

    Split form variables not retaining value

    Hi, is anyone else finding that form variables don't retain their value in split form mode? Is there anything that can be done? Thanks.
  10. T

    Object variable not retaining value

    Hi, I've got an object (called "Super" below) declared as private in a form class ("Form_frmMyForm"). However, it doesn't seem to retain its value after the Form_Open. In the VBE Watch window the value of the object (Super) is marked "<Out of context>" immediately after the Form_Open...
  11. T

    Class inheritance

    Well, I just wanted to get a little more info on exactly how to implement inheritance. My problem, so to say, is that I would like to create a subclass of forms with specialized methods and I would also like to extend the original forms class to include my own additional methods that apply to...
  12. T

    Class inheritance

    Hmm that's what I thought but I got wind you could spoof inheritance with it - forget that then. But is there any other way to simulate inheritance? What's the best option in your opinion? Thanks very much
  13. T

    Class inheritance

    Hi, I've recently read that you can fake class inheritance by using the "implements" keyword. How can this be done? A very quick example would be helpful. Thanks
  14. T

    Form Class_Initialize

    Given that all form modules are class modules, is a Class_Initialize sub valid? Or does the on open event have exactly the same effect? Thanks
  15. T

    String Matching

    VBA equivalent of regex match Hi, is there any function that can find a string and return the match while also supporting the use of wildcards in the needle expression? e.g. for such a function named StrMatch, StrMatch("Haystack", "s*") would return "stack" Thanks
  16. T

    Eval function with variables

    Hmmm. Ok, but what if I have >200 variables? Does this mean that I have to create >200 functions to call each variable? Could I create just one function to reference variables dynamically? E.g. Function VarGet(pVarName as String) As Variant 'Code here - returns value of variable named...
  17. T

    Eval function with variables

    Thanks - but what about a setting like "var1 * var2"
  18. T

    Eval function with variables

    Thanks for your reply. It won't work because that's the literal string that will be stored in the settings table: NAME | VALUE MsgOnExit | "Are you sure you would like to exit " & AppTitle So really, I will end up with the string """Are you sure you would like to exit "" & AppTitle" As...
  19. T

    Eval function with variables

    Hi, is it possible to use the eval function with variables e.g. Eval("foo + bar") or Eval("""The value of foo is "" & foo")? This is because I have my database settings in a table (one field having the name of the setting and the other containing the value) and I wish to be able to reference...
  20. T

    Trigger Subform Event

    Sorry, that was badly phrased. What I mean to say is that if my subform has a button, say cmdSub, I would like to be able to execute the event procedure cmdSub_Click() (or indeed cmdSub_<any event>) from the main form that contains the subform. Essentially, I would like to put controls on the...
Back
Top Bottom