Set Textbox value by selecting item from combobox but it must beeditable

B

billy_pit

Hi,
I have one projrct in MS Access.
I have one form in which there is one Combobx(PalletNo_combo) and one Textbox(ShippedQuantity).
Now when I select an item from Combobox then it will automatically set the value of Textbox.
For that I am using code in control source properties of Textbox
=(DLookUp("val([QTYONHAND])","PRODUCTION","PalletNo=[Forms]!
[ShippingEntry]![PalletNo_Combo]"))

Uptil here its fine.
But after that, in some scenario,I have to change the value of that Textbox.
But when I click on the Textbox and enter something then it will show me this

control can't be edited;it's bound to the expression (DLookUp("val([QTYONHAND])","PRODUCTION","PalletNo=[Forms]!
[ShippingEntry]![PalletNo_Combo]"))


So I want to change the value in only some cases,like 1out of 100,if i have to change it then what to do?I want to make that Textbox Editable so i can edit it

How can i do that?

Thanks
 
L

Leif

Establish a recordset for the form. The recordset sound have atleast two
fields, the value of the drop down box and the value you want displayed in
the text box. Bind the control for the text box but not the combo box. Use
the AfterUpdate method of the combo box to get control when the item is
selected. Use the results of the combo box to find the corresponding value
in the recordset. The value in the text box will be shown and should allow
you to update.

billy_pit said:
Hi,
I have one projrct in MS Access.
I have one form in which there is one Combobx(PalletNo_combo) and one Textbox(ShippedQuantity).
Now when I select an item from Combobox then it will automatically set the value of Textbox.
For that I am using code in control source properties of Textbox
=(DLookUp("val([QTYONHAND])","PRODUCTION","PalletNo=[Forms]!
[ShippingEntry]![PalletNo_Combo]"))

Uptil here its fine.
But after that, in some scenario,I have to change the value of that Textbox.
But when I click on the Textbox and enter something then it will show me this

control can't be edited;it's bound to the expression (DLookUp("val([QTYONHAND])","PRODUCTION","PalletNo=[Forms]!
[ShippingEntry]![PalletNo_Combo]"))


So I want to change the value in only some cases,like 1out of 100,if i have to change it then what to do?I want to make that Textbox Editable so i can edit it

How can i do that?

Thanks
 
B

billy_pit

Thanks buddy for ur help.
But I got the solution I just remove the code from the control source
property and then using the afterupdate event of combobox and set the
value of textbox with that code and now its working properly.
Thanks again for ur help, ur concept is also right buddy I check it
also, so it will help me in future when I need it.
 

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