Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Posts
    81

    Unanswered: Bound or unbound best practice?

    I display data in controls on many forms and reports from public functions. I can bind the control to the function by setting the ControlSource to =MyFunction(parameter) or I can move data to unbound controls from the function on the form's OnCurrent event as Me.Control = MyFunction(parameter)

    What is the preferred way? It seems the latter is faster.

    Thanks,
    Bjorn

  2. #2
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    if you only go for displaying, you could make form's recordset type to Snapshot and use bound controls so it could display faster because it opens records as read only.
    ghozy.

  3. #3
    Join Date
    Jan 2003
    Posts
    81
    The forms are for display and editing and the controls getting the data from functions are for display only. The question is which is the best way to fill the controls, binding the control to the function or filling unbound controls from form events.

    Bjorn

  4. #4
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    In Access I usualy prefer bound controls. It makes project code more cleaner. I worry about speed only with complex queries and reports. if a form displays its data in 1 second, it is quick enough for me.
    ghozy.

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Best method in that situation is to call the function in the query itself. Next preferred is using vba to populate the unbound control. Normally bound controls are the way to go, but if a function is altering the value of a recordset, I like to see it at a glance in the code editor.

    Note that all this is subjective.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •