Double Click to Add Record from subform to order details subform

G

Guest

Hello,

I need help with something that is probably very easy, but it has been
eluding me none the less. I have a main order form with an order details
subform and a parts list in a separate subform with tabs (both subforms are
on the same form). I would like to be able to select a part from the parts
list subform and have Part Number for the record selected automatically added
to the new record field of the order details subform. There will be multiple
records added to the Order details subform at one time, so after each entry,
it will need to again move to a new record.

I believe that I need to enter VBA code in the On Double Click event of the
property of each tab (form) of the Parts subform, but from all of the
reference books that I have read, I can not find applicable example code.
Basically, I am looking for the code that I need to enter after the On Double
Click event. Thank you for any help that you can give.

My current workaround is to highlight the part number in the parts subform,
right click, select copy, then right click in the part number field of the
Order subform and select paste. It works, but it is clunky to say the least.
Is there an easier way?

Thank you again for your help,

Brian
 
G

Guest

in this case you might consider defining your field in question in the Order
Details Table to be a lookup field from the Parts List table.

admittedly this a level back from where your question is....but might be the
simplest way to accomplish your objective and will work....

essentially your cross reference occurs at the table level rather than the
form level....and now you won't need two subforms since the Parts List Table
is nested inside the Order Detail Table.

there can be reasons not to do it this way.....but in your case it might
work fine and be simple also....in Table design view - redefine the field
using the LookUpWizard option (rather than Text or Number or whatever) and
when this wizard launches just point it to the other table's column to be the
look up source......
 
G

Guest

Thank you for your reply.

Yes, you are correct this will also work, this is the first thing that I
tried. Programatically it does work, but functionally for the end user it
does not. Due to the size of the parts list and the complete knowledge of
all of the parts that would be required by the end user, it becomes an
impractical solution in this case.

With this in mind I moved to the work around of the Cut and paste operation
to allow the end user full access to all data for all parts in a categorized
view.

Thank you again for the reply and consideration that you have given to my
question, but I really need to try to find the code to apply the double click
event to this situation.

Brian
 

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