Grab Unique ID when user selects record

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

Guest

I have a form that has a list box showing sales orders. The data comes from
a 'read-only' table, however, I want users to have the ability to enter
comments on the orders through another form, or other control.

When they click on the order, I have the second form popup using the On
Click event so they can enter additonal information. Is it possible to
'grab' the order number (unique ID) from the list box and transfer it to the
second form automatically?
 
If you want to open the second form filtering on the orderid then use the
where condition to filter on the order id

docmd.OpenForm "FormName",,,"Order id = " & me.listbox.column(0) ' or the
location of the order id in the list box start with 0.
================================================
If the order id is string then use
docmd.OpenForm "FormName",,,"Order id = '" & me.listbox.column(0) & "'"

================================================
If you just want to send another value to the second form the use the openArs

docmd.OpenForm "FormName",,,WhereCondition,,,OpenArgs
' Send and value here and in the second form you can use the me.openargs
to know which value has passed
================================================
 
I understand somewhat of your explaination.

I cannot get the code to move the data over to the second form however.
Here is how it's layed out:

Form1 - "frm_Opty Details"
I want the field called "OTN" from the "Details" List box in column 7 to
transfer to Form2 - "frm_Notes" to the field called "OTN" when the user
clicks on an entry in the Details List Box from "frm_Opty Details".
 
Back
Top