Auto lookup and input

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with all of the open orders for my company but we would like
to create a table to store the orders that are rushed through. One problem is
that about half of the office can do this and so it needs to be user
friendly. Now what I am trying to do is create a form that will look up and
auto fill all of the necessary information that will not change but they need
to look at in order to talk to the customer. Then they can enter in the new
information for delivery and due date, making it much easier and avoiding all
unnecessary data entry (they won't use the form if it takes too much time).

I can set up a look up combo box to fill in one field in the form but not
all of them at once. I am afraid I am not that skilled at the actual code of
Access yet, please help!
 
I recently tried by entering this code into the OnExit for the work order
number:
Sub wo_no_Exit(Cancel As Integer)
Dim varcustomer_po_no, varcustomer_cd, varcustomer_name, varplant_no,
varproduct_cd, varproduct_name, varstart_qty As Variant
varcustomer_po_no = DLookup("custmer_po_no", "'open_wo", "wo_no = [wo_no]")
varcustomer_cd = DLookup("customer_cd", "'open_wo", "wo_no=[wo_no]")
varcustomer_name = DLookup("customer_nm", "'open_wo", "wo_no = [wo_no]")
varplant_no = DLookup("plant_no", "'open_wo", "wo_no = [wo_no]")
varproduct_cd = DLookup("product_cd", "'open_wo", "wo_no = [wo_no]")
varproduct_name = DLookup("product_description", "'open_wo", "wo_no
=[wo_no]")
varstart_qty = DLookup("start_qty", "'open_wo", "wo_no = [wo_no]")
If (Not IsNull(varcustomer_po_no)) Then Me![customer_po_no] =
varcustomer_po_no
If (Not IsNull(varcustomer_cd)) Then Me![customer_cd] = varcustomer_cd
If (Not IsNull(varcustomer_name)) Then Me![customer_name] = varcustomer_name
If (Not IsNull(varplant_no)) Then Me![plant_no] = varplant_no
If (Not IsNull(varproduct_cd)) Then Me![product_cd] = varproduct_cd
If (Not IsNull(varproduct_name)) Then Me![product_name] = varproduct_name
If (Not IsNull(varstart_qty)) Then Me![start_qty] = varstart_qty

End Sub

This did enter values into my form for those values but when I tested with
different work order numbers the values given by the first entry kept being
entered instead of changing per work order.

Any suggestions would be immensely helpful.
 
Back
Top