Text box on a form

Charlie2

Registered User.
Local time
Today, 17:32
Joined
Mar 28, 2002
Messages
79
I have a problem, I have a combo box on a form showing supplier codes, I want to place a text box next to the combo box to show supplier name, whenever I try to do this I get an error, its strange because the text box will let me link other fields.
please take a look at it here.

http://homepage.ntlworld.com/charlie_chuck/Invoice09.mdb

The form is called frmInvoice1

Thanks
Charlie
 
Create your unbound control and call it SName. In the After Update event ([Event Procedure]) of your combo box 'Supplier code' put this line of code:

Me.SName = Me.[Supplier code].Column(1)

hth,
Jack
 
Appreciate it.

Thanks.
 
Did That but

It may be me, I still get the #error instead of the names of suplliers, the control source in the properties of the text box is SName, is this correct.
I cant understand what is wrong, I think I must have an error somewhere else.

Charlie
 
In the After Update event of your 'Supplier code' combo box did you select [Event Procedure] and put the code I gave you in the After Update subroutine? If you did then then the code I gave you should work if you copy it exactly.

Jack
 
ya

Copy n paste, I agree it should work, at least it gives me the option of selecting SName, supplier name was not in the list before.


Charlie
 
Well

Sorta half working, the SName is available for selection for the text box, but the #error still occurs if i select it, any other selection works.
Did you try this on the file yourself?
Did it work for you?

Charlie
 
Now I am getting confused as to what you want. I assumed you wanted to select a value from the Supplier code combo box and have the name of the supplier appear in the unbound text box after the selection was made in the Supplier code combo box. That is what my solution does. If that is not what you want to do then you will have to explain it to me again.

Jack
 
Thats what I want

Exactly so, but when I try the procedure you describe, which is: select properties of combo box supplier code, select event tab, after update [event procedure] paste Me.SName = Me.[Supplier code].Column(1) after [event procedure]
Go to text box properties, name it SName, select data tab control source, choose SName then I run the form and get '#error in the text box display.

Charlie
 
Thanks

Yours works fine but mine still wont, I will just have to try and try again until it does, the name of the game is learning this.

Thanks Again

Charlie
 
All you need to do is add an a Text box to the form and name it SName. Do NOT put anything in the Control Source for this text box as you want it unbound. This text box is there to display the Supplier Name only.

The only code is in the After Update event of the Combo box. Once you remove the Control Source from the text box everything should work. Sorry, but I missed that in your explanation of what you had done...

Jack
 
At last

I did it, thanks for your patience, i bet you hate me.

Charlie
 
Charlie -

Congratulations! Persistance wins again... And I don't hate you... There is not one of us out here who was born knowing Access. We, like you, had to learn it just like you are learning it.

Continued success with your project.

Jack
 

Users who are viewing this thread

Back
Top Bottom