double click event

  • Thread starter Thread starter Dave Smith
  • Start date Start date
D

Dave Smith

hi, i would like to double click on a field in my list box, and have that
record copied to an adjacent list box. i will print the contents of the
second list box afterwards, but for now i just need to get the field in
there.

thank you for your time.

Dave
 
Dave

I assume you mean something like what happens when you use one of the "new"
wizards (e.g., new query).

The concept behind the appearance is that you have two sources of data. The
source for the list in the first list is either all available items or, to
be fancier, all available items that are NOT chosen. The source for the
second (your "adjacent") list is a query that finds only the chosen items.

Since whatever your "main form" underlying record is can have zero, one or
many chosen items, you are probably better off using a table to hold
MainTableID plus ChosenItemID.

To get an item into the chosen list/table, you add code behind the
form/event to add the item selected in the first box to the underlying table
of the second box, then requery the second box. If you are using the
fancier version of the first box, you requery it also, to "remove" the
chosen item.

I couldn't tell from your post -- is this what you were looking for?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
yes this is the right kind of idea, sorry to have not been clearer. i really
need to "copy" the record to the second list (not remove it from the first),
i don't know what code i would need though to do that...

i also would like to delete everything in the second list so as to start
fresh the next week...

appreciate your time,

Dave
 
Dave

It is rarely necessary to "copy" a record from one table to another, and can
cause you (and Access) considerable extra work. Am I taking your statement
too literally? Are you actually trying to copy all of the data in Table1,
row#### into Table2?

The second list needs to have a source. To "put" something in the source
for that second list, you'll need to either use an append query or the
underlying SQL statement (use Access HELP to look up "INSERT", examples).

To delete everything in a table, you'll need to either use a delete query,
or the underlying SQL statement (look up "DELETE", examples).

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 

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

Back
Top