Search results

  1. Notiophilus

    Solved Parametrised query: "type conversion failure" when inserting dates, e.g. Now()

    Trying to insert a date with a parametrised query, but it always fails: "Microsoft Access set 1 field(s) to Null due a type conversion failure..." I've tried inserting Now() - which is what I want - CDate(01/02/2003), 01/02/2003... nothing. I'm sure the answer is really obvious, but googling has...
  2. Notiophilus

    Trying to simplify update/insert in two linked tables

    I have a list of authors, each of which may go by multiple pseudonyms. One of these is the "main" pseudonym and is displayed in forms, reports etc. (E.g. "JRR Tolkien" is the main pseud, synonymous to "John Ronald Reuel Tolkien" and "hobbitlover1") tblAuthor: AuthorID [PK, autogenerated]...
  3. Notiophilus

    Subform cannot be referenced when placed in a hidden footer - why?

    I use fields in the (hidden) footer of a single form to handle validation checks. Recently I needed to include a bound subform, and discovered that if the subform is placed in the hidden footer, VBA cannot reference it: error 2455, "You entered an expression that has an invalid reference to the...
  4. Notiophilus

    What do the events Form_CommandExecute, CommandChecked, CommandBeforeExecute etc actually DO?

    Access 2010. Trying to understand more about event order on forms, I ran into the Form events CommandBeforeExecute, CommandChecked, CommandEnabled, and CommandExecute. They look intriguing and possibly useful, but what do they actually do, and what triggers them? According to Microsoft's help...
  5. Notiophilus

    Bypass Form_BeforeUpdate validation when switching to a subform

    I have a bound parent form with two subforms. If the user tries to leave a record without having entered certain key data (title, summary, link), the form challenges them: they can either cancel and stay on the record to enter the missing data, or keep going, and the incomplete record will be...
  6. Notiophilus

    Solved Nz(control.DefaultValue) returns Null, not 0 or "". Why?

    ETA: IGNORE EVERYTHING, I'M AN IDIOT I have some filter controls on my form whose values I save to a bookmarks table on Form_Unload. I save them if and only if the control value (stored in .Tag) <> the default value. Some default values are null, e.g. triple-state checkboxes, so I stuck a Nz on...
  7. Notiophilus

    Solved On Error Resume Next : Exit Sub... why?

    Going through my spaghetti code I find the following error handler: ExitHandler: On Error Resume Next Exit Sub ErrHandler: Call LogError Resume Next End Sub What's the purpose of "Resume Next" right before exiting? Can Exit Sub throw an error? I see this all over the place...
  8. Notiophilus

    Run code ONLY on record change/close

    Access 2010. I want to run some code when you change record or exit the form: check if title AND summary AND link are blank, and if they are discard the record check if record is a duplicate and then do stuff if everything is OK, then commit unbound fields Form_BeforeUpdate / AfterUpdate...
  9. Notiophilus

    Mimicking hyperlink behaviour (tooltip, cursor) in VBA

    [SOLVED] Mimicking hyperlink behaviour (tooltip, cursor) in VBA I want to use my own VBA hyperlink function, which is just FollowHyperlink + error handling to copy broken links to clipboard, to replace the default =[Title]#[Link]#. It works perfectly, but is there a way to mimic, in a...
  10. Notiophilus

    Trouble with WITH... and report

    Access 2010. I have a subform which dynamically shows either a form or a report. On the main form there is a button to clear the recordset and filters of each, and for clarity's sake I used a with... end with statement. Access disnae like it. With the form, this works: If...
  11. Notiophilus

    Query for duplicates across two tables

    I have two tables in a one-to-many relationship, tblBooks and tblBookAuthor. A book may have multiple authors, and several books may have the same title. [tblBook] [tblBookAuthor] BookID (PK) Title BookID (PK) AuthorID (PK) ----------- --------------...
  12. Notiophilus

    Strange behaviour - filters are not remembered between loads

    I have a search form which suddenly stopped remembering filters between loads. I managed to accidentally replicate the behaviour on a second database where I knew the filters worked - in this case the code was Private Sub Form_Unload(Cancel As Integer) Me.Filter = "(False)"...
  13. Notiophilus

    Control with values from a query OR a table

    I have an option group which should display a value from a table if txtWords is null, but the result of a query if txtWords is not null. But though it shows the right results when I load the form, updating txtWords gives me all sorts of errors. Can someone help me work through this? txtWords is...
  14. Notiophilus

    Sort the combobox displayed value

    Combobox displayed value Hello! New user here :) and quite new to databases, too, so forgive me if this is an easy question :o I have a combobox which lets you select from a list of pseudonyms. Each pseud belongs to an author; authors can have multiple pseudonyms and exactly one main...
Top Bottom