Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2004
    Posts
    64

    Unanswered: Can you populate unbound fields in a continuous form

    Can you populate unbound fields in a continuous form. If yes, how do I do it

    Peter

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Peter.t
    Can you populate unbound fields in a continuous form. If yes, how do I do it

    Peter
    Yes. But each column will contain the same value ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    translation: that's Mike's way of saying "no"

    izy
    currently using SS 2008R2

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by izyrider
    translation: that's Mike's way of saying "no"

    izy
    LOL!!!! Ah, Izy ... But they had asked the question in a different way the answer would have been "No" ...
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    So I'll pipe in: How would you prevent that? If I had a list of peoples names pulled from the DB and an unbound combo box for hair color could you make it so that i can select green for person one and red for person 2 etc.. w/o it changing evryones ?
    Darasen

  6. #6
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    i'm a bit rusty with bound forms, but it goes something like this:

    have a header section that also looks at the bound fields of the continuous detail.

    when a given record if OF the continuous is current, the header should update with the appropriate data. the header can contain as many unbound fields as you can fit on the screen.

    in effect - you turn the continuous form into nothing more than a list-with-formatting.

    izy
    Last edited by izyrider; 02-18-05 at 14:53. Reason: OF not IF
    currently using SS 2008R2

  7. #7
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by izyrider
    in effect - you turn the continuous form into nothing more than a list-with-formatting.

    izy
    Or you're trying to do a poor man's subform ...

    Darazen,

    Here's the problem: an unbound control by definition WILL NOT look at (will not see) the data in a bound form ... And when you do make an assignment (generally thru the control's name) that assignment will show for each row of a continuous form (think of a sequence of individual forms stacked together where the unbound control resides in each form) you set them all the same. Izy's idea is somewhat of an "exploded view" of a record where the header displays a single record at any given time ...
    Back to Access ... ADO is not the way to go for speed ...

  8. #8
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Different colors

    In regards to changing the colors of bound/unbound controls, have you looked at Conditional Formatting? This might be a solution to Darasen's question. My answer on populating a continuous unbound form with different data would be the same as M Owen and the others (i.e. Yes but it would be the same data), but maybe there could possibly be a way somehow utilizing the OnCurrent event procedure and some tricky programming (not sure offhand how though but it may be possible).
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  9. #9
    Join Date
    Sep 2010
    Posts
    1
    Great thread - thought I might chime in about using unbound controls on continuous forms.

    Some background first. I have a continuous form that uses as its record source a query that is read only (cannot be updated). I want to give users the ability to update a certain field though. We'll call it textbox1.

    I used an unbound text box (with a transparent background) that is placed directly over the field to be updated. We'll call this textbox2. When Textbox2 is entered, the value of textbox1 is read into textbox2. Since the two text boxes are aligned the same, have the same font, point size, and color, the user is unaware that they are editing data in an invisible text box hovering over another text box. When the user finishes editing the value in the textbox2, code associated with AfterUpdate event fires and updates the record. Finally, the form is re-queried and the updated data is displayed

    Great idea, right? Wrong! As this thread discusses, values in an unbound control will repeat in the continuous form, which makes quite a mess.

    However, I may have stumbled across a solution!

    The key is how the controls are stacked. Place textbox2 BEHIND textbox1. (select textbox1 and format using BRING TO FRONT, or select textbox2 and format using SEND TO BACK)


    -- textbox1 --
    textbox1.Enabled = true
    textbox1. Locked = true
    sub textbox1.click => me.textbox2.setfocus

    -- textbox2 --
    sub textbox2.GotFocus => me.textbox2 = me.textbox1
    sub textbox2.LostFocus => me.textbox2 = Null
    sub textbox2.AfterUpdate => ... code to update the record, re-query form, and move focus elsewhere


    When textbox1 is clicked, it updates textbox2 in the form. At this point, every textbox2 in the repeating form displays the same value. However, the only textbox2 that is visible is the textbox2 control that has focus. All the other textbox2's on the repeating form remain safely hidden behind their respective textbox1's.

    Hope this helps.

    Randy

Posting Permissions

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