Values of Unbound field are the same on each row - Subform

G

gmelinas

Hi to all Access Experts!

I have a Main form with one subform. The subform is bounded to a linked
table but i added two unbound fields. My problem is that when i type-in
the value to the Unbound fields, all the value of the unbound field to
each row are the same.

The two unbound fields are:
1. QTY_IN - number of pieces in a package. Example: there are 6
"QTY_IN" in 1 case.
2. QTY_UOM - number of packages. Based on the example above, if you
type-in 6 for QTY_IN the QTY_UOM will be automatically be 1 (for 1
case).

Do you have any suggestions on how i am going to go about this problem
if there is no other solution to the Unbound fields? Why does the value
of the unbound fields repeats to each row?

Thanks in advance
 
A

Albert D. Kallal

Sicne a contineus form is the repated contorls over and over, if they are
un-bound, you in fact only have ONE copy of that cotnorl.

So, the "why" is just the way it works. You can't address a particlar
contorl that is repated on a contineus form (you can of couse move to a
particlar record, and use the values of that reocrd, but un-bound controls
have NO way of knowing what reocrd, or values you want to dosplay in the
form.

I would suggest that you simply add throw away fields. You could also I
susppeo bind the two text boxes to custom fucntiosn that return a value, but
you would have to do a few hoops to allow ease of data entry.

I have a example where I have a collm of check boxes in a contienus form,
and to get around the prlbelm of tere only being "one" instacne of each
contorl, I simply bind the check box to a custom function. I suppsoe you
could do the same for your form.

You can find the example here:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

Grab the multi-select example.

So, in your case, if you MUST have the two additional columns un-bound (and,
you made no case as to why..by, the way, you don't necessary have to place
those fields in the main records that you display, but you could join in a
*child* table for those two additional fields -- note that queries in
ms-access that are a join *can be* edited. So, you can well use a relational
model to add in those two additional fields as a child table -- I guess this
begs the question do you need to *eventually* save this data, then if
yes...why not use bound fields anyway???

I mean, what do you eventually do with those values entered anyway? (if they
are un-bound, the instant you close that form, they would be lost
anyway...)..

So, as suggested, you might consider using a child table, and two sub-forms
(the 2nd one would allow you to edit/add/change the qty_in etc).

The following screen shot (last one) shows two continues forms. In the
example, the right side is ALSO a continues form, but in your case it would
only be the qty_in and QTY_UOM that you need to add/edit/change.

And, if qty_uom is a calculated field, then you can bind the text box to a
custom function (as my multi-select example shows).
 

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