Full Version: Unbound Combo Box in Continuous Form
UtterAccess Forums > Microsoft® Access > Access Forms
doodle
Hi UA!
I'm trying to get a unbound combo box to work in a continous form. It's part of an inventory database, and when I select an item on the combo box it set to populate a field.
The combo box is bound to a field of each record that sets the sql source for the combo to display certain items. Once the combo is selected, based on that it will populate a third bound field. That part works.
Here's was doesn't work: In the continious form, when I set one record, it sets them all. When I set another record is resets them all.
Any ideas or suggestions would be great.
Thanks UA!
Jack Cowley
This is a problem with continuous forms as there is really only one combo box shown many times. You will find a solution to this problem here. There are other solutions and you may find one by searching the archives here at UA.
th,
Jack
Mitchell
If the ControlSource of the combo box is not bound to a field when using continuous forms, then effectively it is the same control for each record which is why the selection gets replicated in each record. Without seeing you're db I couldn't tell you for sure what the solution is, only that when I have situations like this, I create a dummy field in the source table so that the combo has something to link to. The field doesn't actually do anything in terms of my database, it is only there so that I have something to bind the combo box to which prevents access from populating every combo box with the same value.
TH
Mitchell
darn beat me to it... frown.gif
Jack Cowley
Given my speed at my age it is something of a miracle that I beat you!!! laugh.gif
ack
doodle
Hi there guys,
Thanks for your suggestions, I've taken them into consideration. what i've done is created a dummy field in one of the two source tables, now I can't update the combo boxes.
I've checked the field properties they are good, does the problem lie in the SQL? or the fact that it is now bound.
Thanks for your time.
doodle
It me again,
Is there a way to extract multiple values from a combo box with multiple columns. I've tried the cbo.column to return a value. but to no avail.
Jack Cowley
Me.NameOfControlOnForm = Me.NameOfComboBox.Column(n)
is the physical column number minus 1 so the third physical column is column(2). The code above would be in the After Update event of the combo box...
hth,
Jack
Jack Cowley
I am not sure why you cannot update the combo boxes. I have seen them go south so maybe you need to delete them and try again. Other than that I have no other ideas...
th,
Jack
Mitchell
laugh.gif of course it is the end of the day here, and I'm beat. Glad to see you're still around frown.gif
fkegley
I also had this problem. I solved it by binding a text box to the table and having the combo box update the text box.
also used code to change the drop down list of the combo box to suitable values for the particular record it was on.
Jack Cowley
I am glad to be around! I have been buried in a db so I have had to forego the pleasures and friends here at UA... I 'should' be back full time in a week or so, assuming the db doen't send me completely round the bend...
ack
Mitchell
...Well you know where to come if it does laugh.gif Good luck with the db.
doodle
Thanks Jack,
Ys Jack,
Your info on the multiple value from combo box really worked out. I laughed at myself when I read it, 'cause after my last post, I was working on it, and thinking to myself, " man, why does it return the wrong column". I read your post and smacked myself. Then when I unbound the combo and set the other fields to values from specific columns, it works like a charm.
But when I bound the fields, errors start coming up. Do you think it might be because I have the bound fields are in a field list of the form that's source is a SQL statement? If so, then I don't know what to do, the SQL statement returns the records that meet a critieria.
This form is meant to populate with a list of records ( in continous form ) with all the products, ( product ID, product Name) that need to be ordered, ( this is a inventory database), with each product, i select a supplier which populate the price field.
At the bottom I hit the Multiple Purchase Orders button, makes the necessary PO's and off ya go. There are two tables that fuel this form, so a fitler is not a good idea.
Do you have any tricks that might work?
doodle
Thanks Jack,
Ys Jack,
Your info on the multiple value from combo box really worked out. I laughed at myself when I read it, 'cause after my last post, I was working on it, and thinking to myself, " man, why does it return the wrong column". I read your post and smacked myself. Then when I unbound the combo and set the other fields to values from specific columns, it works like a charm.
But when I bound the fields, errors start coming up. Do you think it might be because I have the bound fields are in a field list of the form that's source is a SQL statement? If so, then I don't know what to do, the SQL statement returns the records that meet a critieria.
This form is meant to populate with a list of records ( in continous form ) with all the products, ( product ID, product Name) that need to be ordered, ( this is a inventory database), with each product, i select a supplier which populate the price field.
At the bottom I hit the Multiple Purchase Orders button, makes the necessary PO's and off ya go. There are two tables that fuel this form, so a fitler is not a good idea.
Do you have any tricks that might work?
Thanks for your time and patience with me.
Jack Cowley
At this point I do not know why your form is not doing what you want it to do. The fields in the SQL are coming, I assume, from the table just like all the other fields so that should not be the problem. Without seeing what you are doing I do not know what to suggest... At the moment I am up to my eyebrows with another db so I do not have time to look at what you have. If you cannot sort out your problem you may want to start another thread so that other members can see what you are up to and may be able to help.
ack
doodle
Jack,
ill do thanks again for your time and consideration in this matter.
Dave.
Jack Cowley
Dave -
You are welcome and good luck with this!
Jack
doodle
WHOHOOO!!!!
I've found the answer!. I've found the way!, . . . well works for me anyway. I'm posting my answer to help anyone else who might give it a try.
- My problem was to get a combo box to display a list of potential suppliers in a continuous form. ( this is for an inventory database).
- My solution is as follows
- I first created a query to search for any products that needed to be ordered, ( fell below min order levels ), this would then collect all the product info for that instance, ( product ID, product Name, etc) as well as other infor from other tables concerning said product. ( hopefully you follow )
- I then turned the query in a make table query which would spit out the results into a temp table so to speak.
- I based my form on this table, I could change things variables with no problems. Now with the combo box, I set it up to search by SupplierID and give me the Supplier Name as the BoundColumn. So this made the bound column visible,like what MS recommends in here.
- the user sees the bound column, and when it comes time to put all this info back into 'Normalized tables' I convert the Supplier Name to SupplierID.
Sweet eh!, thanks again to all the guys who posted for your time and consideration. much appreciated.
Until next time
Dave.
Jack Cowley
YEEHAA! I'm glad you found a solution that worked for you! Full speed ahead!!!
ack
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.