Button Simple Search - User Codes

Being fairly new to Epicor customization, I want to add a button called “Reference” that will search the “UDCodes” for CodeTypeID “REFERENCE” and then display the CodeID and Description in search window (see screenshot). When one of the row is selected, it would put the description in the “Reference” textbox in Opportunity/Quote. I went to customization wizard and add a simple search adapter for “User Codes”. However, I can’t get it down to the correct CodeID in the search window. It is only searching the CodeTypeID and not the CodeID. Any ideas?

private void SearchOnUserCodesAdapterShowDialog()
// Wizard Generated Search Method
// You will need to call this method from another method in custom code
// For example, [Form]_Load or [Button]_Click

	bool recSelected;
	string whereClause = string.Empty;
	System.Data.DataSet dsUserCodesAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "UserCodesAdapter", out recSelected, true, whereClause);
	if (recSelected)
		System.Data.DataRow adapterRow = dsUserCodesAdapter.Tables[0].Rows[0];

		// Map Search Fields to Application Fields
		EpiDataView edvQuoteHed = ((EpiDataView)(this.oTrans.EpiDataViews["QuoteHed"]));
		System.Data.DataRow edvQuoteHedRow = edvQuoteHed.CurrentDataRow;
		if ((edvQuoteHedRow != null))
			edvQuoteHedRow["Reference"] = adapterRow["CodeTypeDesc"];