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!

How can I write to 2 columns of a combo with a user-defined function?

Status
Not open for further replies.

WSA

Programmer
Apr 10, 2000
8
GB
Access 97: I've used that complex function format (the one with &quot;acLBInitialize&quot;, etc) to write row-data to a combo box.<br><br>But how can I use it to write different data to both cols of a combo box? If I were using the Value List method I would do it by using semicolon-seperated strings, but I have to be able to use more than 255 chrs so can't use this method.<br><br>Whatever I do, the function repeats the ReturnVals in both columns of the combo box, the next Returnval in both cols of the next row of the combo, etc.<br><br>I tried (rather optimistically) writing (under the &quot;Case acLBGetValue&quot; section of the function)<br><br>ReturnVal = Rowdata1(row) & &quot;;&quot; & Rowdata2(row)<br>where <br>Rowdata1 = array of data for column 1<br>Rowdata2 = array of data for column 2<br><br>but this just concatenates the strings without acting upon the delimiter.<br><br>Very grateful for any help you can give me.<br><br>regards<br><br>WSA
 
Access calls your function multiple times, passing it the row and col numbers it is looking for values for.<br><br>In &quot;Case acLBGetColumnCount&quot;, set the number of columns to 2.<br>&nbsp;<br>In the &quot;Case acLBGetValue&quot;, add code to check the row and col and provide the correct value.&nbsp;&nbsp;In other words, when Access gives you row=1; col=1, pass it the value for the first column.&nbsp;&nbsp;When it passes you row=1; col=2, then give it the data for the 2nd column. <br> <p>Jim Conrad<br><a href=mailto:jconrad3@visteon.com>jconrad3@visteon.com</a><br><a href= > </a><br>
 
Thanks Jim - that sorted it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top