Search results

  1. Notiophilus

    Bypass Form_BeforeUpdate validation when switching to a subform

    That's what I said in my previous comment. The subform is bound to tblStoryAuthor (the junction table). And yeah, I'm using NotInList - almost every story I add has a new author, so it would be a pain to have to add each one separately. ...although you definitely have a point here! Since this...
  2. Notiophilus

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

    Hm, that makes sense - some of the links I found were for Access 2003, so ¯\_(ツ)_/¯ Thank you both for indulging my curiosity!
  3. Notiophilus

    Bypass Form_BeforeUpdate validation when switching to a subform

    The table structure, heavily simplified, is as follows: tblStory [PK: storyID, title, summary, words] tblStoryAuthor [storyID, authorID] - multiple authors allowed per story, although normally there's only one tblAuthor [PK: authorID, name] tblStoryCategory [storyID, categoryID] - multiple...
  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

    Eeesh, I feared as much. Oh well, I'll leave it as an option for the future. Thanks!
  6. Notiophilus

    Bypass Form_BeforeUpdate validation when switching to a subform

    hahaha whoops yeah, that's an error in my post - I was on autopilot. Actual code is okay. and yep, that's all I can see. It just feels a little awkward to give the user the choice to delete the record (if they're just clicking on a subform) or not to delete the record (if they're navigating...
  7. Notiophilus

    Bypass Form_BeforeUpdate validation when switching to a subform

    Yep. The only time I really want validation is when I leave the record, either by closing the form or navigating to another record. (e.g. some other parts of the form create child records, and in such cases I force a SaveWithoutValidation. This works fine.)
  8. 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...
  9. 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.
  10. 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 & ""...
  11. 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)
  12. 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...
  13. Notiophilus

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

    Interesting. Thanks for the explanation!
  14. Notiophilus

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

    Ah, so it's just a leftover of normal good practice. Makes sense, thanks!
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
Top Bottom