James E Harvey wrote:
> I'm trying to allow users to add date to a listbox on the fly. The data is
> coming from textboxes on the form where the user enters data, and then
> clicks an "Add" button.
>
> This code is in the method for the click.
>
> with thisform.hscntcode
> .hslstprint.additem(.hstxtcode.value)
> .hslstprint.list[1,2] = .hstxtdesc.value
> .hslstprint.list[1,3] = transform(.hstxtamount.value)
> Endwith
>
>
> It works for the first item, but not subsequent items as the
> ".hslstprint.list[1,2]" is problematic.
>
> Can't figure how to increment the "1" after .list which is what positions
> the value in the listbox.
>
>
If I understand your question correctly, you need to check out the
NewItemID property. Here's a snippet of code that I use sometimes to
populate dropdowns (which should work as well with a listbox iirc):
SELECT vluEstimators
SCAN
this.AddItem(vluEstimators.cFullName)
this.AddListItem(ALLTRIM(STR(vluEstimators.iid)),this.NewItemId,2)
ENDSCAN
--
Michael J. Babcock, MCP
MB Software Solutions, LLC
http://mbsoftwaresolutions.com
http://fabmate.com
"Work smarter, not harder, with MBSS custom software solutions!"
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.