Unbound field

D

Don Rountree

Help. I have a continuous form with an unbound field.
When I enter a value in the unbound field, that same
value fills every line of the continuous form in that
text box. Is there a way to enter the value in one line
of the continuous form and not have that same value fill
the same text box on every other line? I could use some
help here. Thanks in advance.

Don Rountree
 
T

TC

Don Rountree said:
Help. I have a continuous form with an unbound field.
When I enter a value in the unbound field, that same
value fills every line of the continuous form in that
text box. Is there a way to enter the value in one line
of the continuous form and not have that same value fill
the same text box on every other line? I could use some
help here. Thanks in advance.


Only with quite a bit of coding. It needs a good understanding of various
things including arrays, recordsetclones, absoluteposition, controlsources,
and keystroke events. So it is usually better not to attempt it! This is an
unfortunate restriction of Access continuous forms. Various other db
products (eg. Oracle) do not have this restriction, & are quite happy to
have a "value per row" type unbound field.

HTH,
TC
 
T

TC

John Vinson said:
No, because - appearances to the contrary notwithstanding - there is
only ONE textbox, displayed many times. Unbound fields on continuous
forms simply work this way, and I don't know a getaround.

You *can* do it (subject to a small argument about the definition of an
"unbound" control).

Store the row-values of the "unbound" control in an array. Bind the control
to a function. Have the function synchronize the form's recordsetclone (via
its bookmark), then use absoluteposition to index into the array. By this
means, you can show a different value (of the unbound control) in each row,
without that control being bound to a db field.

Then, you can even make the control updatable, by trapping the relevant
keystroke events, updating the relevant array entry, recalcing the
control(to show the effect of the keystroke), then repositioning the cursor
to where it would have gone, if all of that had hapenned normally!

All of this sounds >>terrible<<, but in fact, it works >>perfectly well<<, &
it looks almost indistinguishable from normal data entry.

None the less, I eventually decided that it is too hard to justify the
effort in remembering how to do it each time.

TC
 
R

Rick Brandt

Don Rountree said:
Help. I have a continuous form with an unbound field.
When I enter a value in the unbound field, that same
value fills every line of the continuous form in that
text box. Is there a way to enter the value in one line
of the continuous form and not have that same value fill
the same text box on every other line?

Nope. There really is only one control. What you see on the other rows is just
a copy of it. The only thing that makes the bound controls different per-row is
the fact that they are bound to the underlying data.
 
J

John Vinson

Help. I have a continuous form with an unbound field.
When I enter a value in the unbound field, that same
value fills every line of the continuous form in that
text box. Is there a way to enter the value in one line
of the continuous form and not have that same value fill
the same text box on every other line?

No, because - appearances to the contrary notwithstanding - there is
only ONE textbox, displayed many times. Unbound fields on continuous
forms simply work this way, and I don't know a getaround. If you want
to see different values on different rows, you must store the field in
some table.
 
J

John Vinson

You *can* do it (subject to a small argument about the definition of an
"unbound" control).

Store the row-values of the "unbound" control in an array. Bind the control
to a function. Have the function synchronize the form's recordsetclone (via
its bookmark), then use absoluteposition to index into the array. By this
means, you can show a different value (of the unbound control) in each row,
without that control being bound to a db field.

"Me 'at's off to the Dook!"

Very clever and elegant, and noted for possible future use!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top