save a dlooked up text box value of a form into table

A

Azad, DH, BD

Dear all genious,

pls help me. I've an entry form that has a combo box to select material
code. After selecting the material code, other two text boxes will dlook up
the material name and unit code of the selected material code from the item
table. Now I'd like to save this two text boxes like other text boxes in the
"Product details" table.

I'd highly request all genious to give me the exact solution. that is how to
save a bound text box into a table that will dlook up value from other table.

Thanx 4ur kind help in advance.
 
D

Dale Fye

Don't do this. Store the material code in the product details table, but
don't store the material name or unit code. This will just waste space in
your database.

BTW, If you want to display the material name and unit code in your form, I
would modify the SQL you use for your cboMaterialCode so that it selects the
material code, material name, and unit code, all in the same SQL statement.
Then, change the Columns property of the cbo to 3, and set the widths to
something like:1"; 0, 0

Now, in the combo boxes afterupdate event, use code similar to the following:

Private sub cbo_MaterialCode_AfterUpdate

me.txt_MaterialName = me.cbo_MaterialCode.column(1) 'zero based
me.txt_UnitCode = me.cbo_MaterialCode.column(2)

End sub

You will also need to copy these two lines and put them in the forms current
event, so that if you go to a record that already exists, it will update
those two textboxes.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 

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