Move/copy from one form to another

  • Thread starter Thread starter Lasse T
  • Start date Start date
L

Lasse T

Hi!
I hope anyone can help me with this.

I´m creating an, as I thought, simple app for sales, order and stock. The
item numbers are long and difficult to type so I created a search form where
I can, with only a few mouse click, find an item family. The result comes in
a new form with only a few items to choose from. Now I want to "pick" one of
those items and get it over to the order form.
I have four tables. Cusomers, Items, orders and order rows. The order form
shows records from customers and items and it adds records to the orders and
order rows tables.
I can not find out how to get the item that i pick from the search result
form over to the order rows in the order form. The whole idea with the
application are the search form so the user wount have to type the item
number or find it in a drop down list.

Thanks in advance

Lasse T
-------------
 
One way would be to use a button on the "search" form to tell ACCESS that
the user has selected the part, and then run code similar to this on that
button's OnClick event:

Private Sub cmdButtonName_Click()
Forms("NameOfOrderForm").Controls("NameOfItemNumberControl").Value =
Me.PickItemControlName.Value
DoCmd.Close acForm, Me.Name
End Sub

Substitute real names for the generic ones shown above. The above code also
will automatically close the "search" form after the value has been written
into the first form.
 
Ok. Thank you very much. I vill try that.

Lasse T
------------

Ken Snell said:
One way would be to use a button on the "search" form to tell ACCESS that
the user has selected the part, and then run code similar to this on that
button's OnClick event:

Private Sub cmdButtonName_Click()
Forms("NameOfOrderForm").Controls("NameOfItemNumberControl").Value =
Me.PickItemControlName.Value
DoCmd.Close acForm, Me.Name
End Sub

Substitute real names for the generic ones shown above. The above code also
will automatically close the "search" form after the value has been written
into the first form.

--
Ken Snell
<MS ACCESS MVP>

Lasse T said:
Hi!
I hope anyone can help me with this.

I´m creating an, as I thought, simple app for sales, order and stock. The
item numbers are long and difficult to type so I created a search form where
I can, with only a few mouse click, find an item family. The result
comes
in
a new form with only a few items to choose from. Now I want to "pick"
one
 
Back
Top