Control Source Problem

Agamemnon

Registered User.
Local time
Today, 19:13
Joined
Sep 18, 2003
Messages
24
Hello,

Hope this question doesn't file for the top 10 Most stupid Ones.

I have a table product and a table promotions. This last table has the primary key (Bcode) of the table products in it.

I also constructed a form in which I input the promotions for the products. To save memory I only save the BCode and not the field "productdescription" in the table promotions. Now, once I have inputted a promotion and I return to that record on the form I only see the 'BCode' and not the 'Description' in a text box.

How can I create a text box "control source" that links the Bcode stored in table promotions with the field "productdescription" in the table products, so that the field "productdescription" becomes visual on my form and not the field "BCode".

Thanks for your help,
Agamemnon
 
No the post just creeps in at number 11 :p

This is very easy to do using a combo box rather than a textbox. That way, you can store the ID, but show the actual text description. Right Click on the existing textbox where you have the BCode stored, Change To -> combo box.

In the rowsource property , click on the ... which will open the Query Builder - add the table Products and add 2 fields, the ID field and the text description to the query. Close this query (confirm yes to update the rowsource)

Change the following properties of the combo accordingly

Column Count -> 2
Column Widths -> 0;
Bound Column -> 1

Now open the form. In the combo should be displayed the Product name and not the ID, if you type a product, Access will 'autolookup' a match to your typing which can speed up inputting.

does this help?
 
Fizzio
Thanks that you want to help m out again, but I've created the following:

5 Comboboxes

Category
SubCategory (Cascading)
SubCategory (Cascading)
Brand (Cascading)

Description (In this one only the productdescriptions are mentionned that fulfil the selection made using the other comboboxes.

In the Combobox Description I Can See the fields 'BCode' and 'ProductDescription'

When I click a product in the Combobox Description only the BCode is remembered. And when I return to the previous record the Comboboxes (Category, ...,Brand) are Empty and consequently the Combobox Description also. So I can't see anymore what product I've inputted.
Now I just want to create a "combo box" that doesn't need a "rowsource" (I don't want to use it for input, but just for checking).

I hope things are still clear.
Agamemnon
 
If your combos are cascading, you will need to requery then on the Form_Current() event (I'm sure) otherwise they will not show the records relevant to the parent combo. Search here for cascading combo and look for a demo posted by Hayley Baxter - that should point you in the right direction on how to use them correctly
 
I know that when you requery them, they will pop-up the next time you go to a record on the form. But I think it only happens when you store actually the values in a field of the main control source table. I do not store the different values of the comboboxes in the table "promotions", they are just there to make my selection easier. But I'll look for that demo.
 

Users who are viewing this thread

Back
Top Bottom