General information
Category:
Forms & Form designer
Title:
Listbox for records not in range
I have a grid full of children. Originally, these children were not a separate table. There was a single field in the parent table which would hold something amorphous like "188.1 - 188.8, 203, 205" which would appear like that on the reports. This field would contain a single number, a range of numbers, or a range + some individual numbers. Each individual number is now a child record (ten of them in the above example). However, I need a way to show, both on the form and on reports, the range and the individual records. I have decided to have two textboxes for the range start and end, and a listbox for the records not in the range. In the above example, txtbox1.value = 188.1, txtbox2.value = 188.8, and lstbox would have 203 and 205. When displaying a record in the form, txtbox1 and txtbox2 are bound to fields startrange and endrange in the parent record, and lstbox will show all children of that parent record WHERE NOT BETWEEN(childfield, startrange, endrange)
Finally, here's my question: what is the fastest, most efficient way to keep that listbox full when navigating records? I'm going to use the listbox differently when adding records. I can put the above expression in the lstbox.Refresh inside a IF NOT THISFORM.Editmode ... ENDIF. I'm just afraid that if I don't do this just right, I'll get something really sluggish. For example, should I SELECT ... INTO CURSOR and make the cursor the rowsource? Or should I make the .RowSourceType = 3 - SQL Statement? When THISFORM.Editmode = .T. and I'm adding or editing, lstbox will hold a cursor full of selected child numbers to be saved as child records when I click the Save button. Its rowsource will be changed around when that happens.
Thanks for your patience, all.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only