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

    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...
  6. 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
  7. 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.
  8. 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...
  9. 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
  10. 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
  11. 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
  12. 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...
  13. T

    Trigger Subform Event

    Hi, how can I trigger an event in a subform? e.g. if I have a hyperlink in the subform, I can access/execute the onclick event in the main form? Thanks
  14. T

    Run Make Table query automatically

    Hi, is it possible to run a Make Table query automatically on opening another query (who takes values from the table created by the Make Table query)? Thanks
  15. T

    Unknown collection

    Hi, I seem to be able to refer to certain fields in forms by Me.Table_Fields.Value even though they don't seem be part of the controls or recordset.fields collection. What collection is named by access like this since I would like to refer to this data like the controls collection...
  16. T

    Dynamic fields reference

    Hi, is there a way to refer to form fields (not controls) dynamically through a variable? I am able to make absolute references to fields, i.e. like Me.tblA_Field1, but I need really to be able to make dynamic references like Me.VarContainingTable_VarContainingField. I'm not really sure what...
  17. T

    Multiple one-to-one relationships

    I have a contacts table, tblContacts, containing info on people and companies (e.g. Northwind corp.). However, I plan to create two new tables, tblContactsPersons and tblContactsCompanies, to contain the data that isn't relevant to all contacts (for example, company contacts do not require a...
  18. T

    Formatting Foreign Keys

    Hi, I'm having trouble using a lookup field with foreign keys containing formatting that violates the lookup field's data type - I was under the impression that formatting did not affect the underlying data stored. For example, if I have a numerical foreign key with formatting 0000-0000-0000...
Back
Top Bottom