Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

listbox duplicates and opening forms to new records

Status
Not open for further replies.

nkrukovsky

Programmer
Nov 4, 2003
5
US
I have two small (I hope) questions.

1- I have a listbox that lists client names. The listbox values are generated by a query. If you click on a client name, it generates an activity report for that client. If there are 'x' entries per client in the table, the client's name appears 'x' times in the listbox. How can I eliminate the duplicates in the listbox?

2- I have a command button that opens a form for contacts/mailing list. I would like the form to open on a new record and ready to input data. It currently opens on the first record by default. How can I resolve this?

Sorry if these questions are basic. I am quite new to VBA and can't find the answer to these issues. Any help would be appreciated.

Thanks,
Nick
 
1. Use a SELECT DISTINCT (group by) query for your listbox source.
2. Change the Form's DATA ENTRY Property to "YES"
 
Or...
DoCmd.OpenForm "frmContactsLookup", acNormal, "", "", acAdd, acNormal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top