Search results

  1. 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...
  2. Notiophilus

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

    ...the default value is "Null". Not Null, but "Null". It's a string. Jesus Christ on a bike. I create my own problems.
  3. Notiophilus

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

    I'd heard that before, but I keep forgetting it. Good to be reminded! @theDBguy, here you go: For Each ctl In Me.Form.Controls If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Or ctl.ControlType = acCheckBox Then If ctl.Tag & "" <> ctl.DefaultValue & ""...
  4. Notiophilus

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

    Wrote it into debug. What alerted me was that ctl.Tag (which defaults to "") <> Nz(ctl.DefaultValue,""), so the bookmark code was storing a bunch of empty controls unnecessarily. (eta: also damn you're fast)
  5. 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...
  6. Notiophilus

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

    Interesting. Thanks for the explanation!
  7. Notiophilus

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

    Ah, so it's just a leftover of normal good practice. Makes sense, thanks!
  8. 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...
  9. 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...
  10. Notiophilus

    Mimicking hyperlink behaviour (tooltip, cursor) in VBA

    Thanks! That code works too, though it doesn't recognise changes from [link] to [no link] until you pass over two records, for some strange reason. I ended up using an API function to change the cursor and it works very smoothly, with zero flicker. Final result, for the benefit of anyone with...
  11. 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...
  12. Notiophilus

    Trouble with WITH... and report

    That seems to have done it. Thanks! @Ranman - but reports do have a filter function. Why not use it? By having both recordsource query and filter I can toggle the filter on and off without performing the query again. (Filtered fields are those I might want to toggle - let's say whether I own...
  13. 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...
  14. Notiophilus

    Query for duplicates across two tables

    Again, see my original post. That is essentially what I did (though this is maybe a mite neater). What I want to know is: can I skip the intermediate query?
  15. Notiophilus

    Query for duplicates across two tables

    Read my post: I used the query wizard, which gave me the two queries I listed above. The wizard doesn't let you make a single query for two tables, which is what I want.
  16. 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) ----------- --------------...
  17. 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)"...
  18. Notiophilus

    Control with values from a query OR a table

    Sorry it took me so long to get back to this... I'm crap at closure. Ended up fixing it myself when I made the simplified database. There were two problems: optLengthCat wouldn't update with txtWords unless I left the record, because the record needed for the query hadn't been written yet...
  19. Notiophilus

    Control with values from a query OR a table

    I've gone over it in different cases - turns out the variable is taking on the value of the query before I changed the amount in txtWords. Will upload a simplified version of my database.
  20. Notiophilus

    Control with values from a query OR a table

    Trouble is, the option group won't update with the query results afterwards. I checked in debug mode, and the DLookup from the query gives 'Empty' when I mouse over. Dim LLength As Variant LLength = DLookup("[LengthID]", "qryLength", "[StoryID] = " & Forms![frmStories].[StoryID]) = Empty...
Back
Top Bottom