logic problem, is there a better way?

codingboy
09-11-2003, 03:18 AM
hi, this is a strange one, and i wonder if there is a better way of doing this. What i am attemping to do is as follows. A customer can purchase any numer of items from us, which we deliever per month, and bill per month. So, we have aprox 100 items available. Per customer, I load a form. With a listbox, this list box contains all the items. This is a checked listbox. So, when a customer orders a new item, we just tick the check on the list box, and write this to the database, so when we load the form again, the box is checked.

on load of the form,if the item is checked, i fill a msflexgrid, with item quantity and item value, and balance owed per month.

All sounds simple, but its turned into a nightmare.... here's my pseudo code....

form load()
Fillist
Check if in list
set-up grid
LoadData to grid
end


fillist()
select all from dbase
add to list
end

check if in list()
select * from table
for x = 1 to list.count
rs.movefirst
if rs.findfirst list(x) = true
then list(x).selected = true
end if
next x
end


setup grid()
just sets rows and cols
end


loaddata()
with flexgrid
for x = 1 to list.count
select * from dbase where xx = list1.selected

.textmatrix( x + 1, 2) = rcset.fields(2)

end with

end



thats it!!!!

basically, its nasty , cos each time i want to i select, or deselect an item from the list, it has to read/write everything again.....

any ideas?


__________________

Squishy
09-11-2003, 10:34 PM
Could you implement a "Check Out" button that would save all changes made to the list instead of saving every change in real-time? (i.e. Select items > Check Out > Select Quantities, calculate (sub-)total > Payment options)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum