copy text from one field into a form into another

D

Dan

I have a subform which displays the list of committee members in a main form
that lists the committee. I have a cammand button that looks up ID numbers of
the organizations members so they can be added to the committee when
appropriate. The command button opens a popup asking for the name, which then
opens anotherpopup with the ID number.
I am trying to write a macro which copies the ID, closes the popup, goes to
the new record on the ID field in subform and pastes the copied ID, and then
moves the focus to the next field.
Any suggestions?
 
T

tina

suggest you use a combo box control in your subform. bind the combo box to
the ID field in the subform. base the RowSource on the table that lists all
organization members, as

SELECT IDFieldName, MemberFirstName & " " & MemberLastName As FullName FROM
MembersTableName ORDER BY MemberFirstName, MemberLastName;

substitute the correct table and field names, of course. set the combo box's
ColumnWidths property to
0"; 1.5"

now the combo box droplist will show the names of the organization members,
and when a member's name is chosen, the member's ID be saved in the ID field
bound to the combo box control, and * the member's name will show in the
control in the form.*

with the above setup, you don't need the command button, or the first popup
form, or the second popup form, or the macro.

hth
 
D

Dan

I should have mentioned that I am trying to use the subform to add or delete
members from the committee. And that's why I don't think your suggestion will
work.
Before adding a member, I want the user to lookup the ID number of an
organizational member (to avoid duplications, etc). This is what the popups
do. The first one asks for the last name and the second provides a list of
everyone in the database with that name. The user would then post the correct
ID number to the New record in the subform. To assit the users and reduce
errors, I want the popup command button to copy the ID number, close the
popup, and copy the ID number into the New record ID field of the subform.
Thanks for your suggestiona and Happy Holidays.
 

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