Automatic Updating

wop0703

Registered User.
Local time
Today, 03:18
Joined
Jun 1, 2005
Messages
77
I have a form that has a combo box. The row source of the combo box is a query with 3 fields. I also have a text box located to the right of the combo box. I would like the first item to the left in my combo box to show up in the actual combo box when selected. Then I want the value of the second field to be automatically placed in the text box. I had this working kind of when my text box was a list box and in the combo box code i put

Me.MyListBox.Requery

But this changed all of my records from that point on. Everytime I change the value in the combo box, the list box value changed for every record.

Please Help.
 
Yes, but I want to be able to add records too. And the towns would be different in every record. Could you modify the form to do that?
 
Also, in the text Box you have =Combo0.Column(2)

When I do that to mine it puts [] around Combo0 and it does not work
 
wop0703 said:
I want to be able to add records too.

If you search for "not in list event" this should give you several ideas of how to "add records" , I am assuming that you wish to add records to the combo box list.
 
There is an example database here which also shows you how to use the "not in list" event. You need to download the sample database " One Form Example", item number seven.
 
I mean go to add a whole new record. Like in your form. I would like to choose Reading and the number come up but then I want to go to 2 in the bottom left hand corner and choose Kintbury and have these values (Reading ### and Kintbury ####) stored in a table
 
wop0703 said:
have these values (Reading ### and Kintbury ####) stored in a table


The combo box shows you a list of entries that exist in one of your tables. What you suggest, having the actual values transferred to and stored in your table is not considered a good practice. The usual method is to store the row number from the particular table where the information is.
 
wop0703 said:
Also, in the text Box you have =Combo0.Column(2)

When I do that to mine it puts [] around Combo0 and it does not work

You are experienceing this problem because "Combo0" is the name of the combo box in the example. You will need to substitute the name of your combo box here.
 
wop0703 said:
I did that, and it is still not working.

From your first post, the query your combo box is based on returns three fields, if it does then the text box should show the contents of the third field, is it possibly that the third field is empty?

If that is not the case, then please provide a more detailed explanation of what you have done.
 
OK, so I have a combo box that is fed from a table. The table has two fields which are both seen in the combo box. One value is a name. The other value is a number that is unique to that name. I want the name stored directly in the combo box (which happens) and I want the corresponding number stored in the text/list box next to the combo box. Now these two stored values are fed back into a separate table which records everything the user inputs. So the user can choose one name, then move to the next record and choose a diifferent name. Any help getting that number into the box next to the combo box?
 
wop0703 said:
The table has two fields which are both seen in the combo box

You incorrectly stated in your first post, that this table (query) has three fields. This is why it will not work for you.

You need to change the (2) to a (1).
 
It still did not work, even with putting LocationShortName.Columns(1) . It still puts [] around LocationShortName . I am running Access 2000, is this maybe the problem.
 
And I fixed it. User error. I was typing Columns instead of Column. I apologize for all of this. Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom