Re: Ridding myself of "You are about to add n records to a New Table"



"David C. Holley" <DavidCHolley@xxxxxxxxxxxx> wrote in message
news:%23S9UTU64FHA.3416@xxxxxxxxxxxxxxxxxxxx
> handn't thought about. I typically only use WITH's if there are
> numerous statement to execute. Not just a handlful.

I tend to use "With" any time I'm going to be referring to an object
more than once in a short section of code, especially if the object
reference needs to be interpreted (e.g., Forms!FormName). That way I
save on whatever time it takes to parse the reference and locate the
object. It probably doesn't make much practical distance, but it feels
tidier to me. I don't think any efficiency considerations would apply,
though, when if the object reference in question is already stored in an
object variable.

I also like using "With Me!ControlName" whenever I'm going to be
referring to multiple properties or methods of the control, because that
way if I ever want to change the name of the control, or copy the same
code for another control, I only have to change the name in one place.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.



Relevant Pages

  • Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)
    ... the context of the reference and the location of the target control. ... The following ways are fully standards-compliant (the proprietary `document' ... Referring to a control that is not located within a form, ...
    (comp.lang.javascript)
  • Re: Error Msg
    ... If you are referring to code in a command button's Click event, ... I have some event procedure coded in the Save click command. ... getting a msg when I click the save button "You can't reference a ... property or method for a control unless the control has the focus". ...
    (microsoft.public.access.forms)
  • Re: When to use "." and when to use "!"
    ... but when referring to controls on forms one uses "!". ... syntax. ... the same control from outside of the form's frame of reference. ...
    (comp.databases.ms-access)
  • Re: Reference Subform Text box to From Text box
    ... Note that when it talks about Subform1 or Subform2 in that reference, ... referring to the name of the control on the main form that holds the ... subform, not the name of the subform. ... form, the control will be named the same as the form that you dragged, ...
    (microsoft.public.access.modulesdaovba)
  • RE: Built in function errors.
    ... located on other tabs in a tab control. ... I had to find a way to use the reference. ... TLBs on the client computer. ... reselect libraries simply makes the application not worth building using ...
    (microsoft.public.access.modulesdaovba)