selecting records on subform

Hi I have a subform in a form. I have a button say ‘select’ in the main form. when i clik the select button i should be able to get the records selected on the subform.(supposing there are 4 records displayed on the subform and if choose 2 among them then i should get those two record). thanx MK

You can access a subform by giving the subform control a specific name, e.g. MySubform, and then write in the main form’s code. You can substitute any function defined in your subform for “xxx”, as well as things like GETRECORD etc. This enables you to write and invoke a function in your subform that returns the currently selected records, if the standard functions or properties do not fulfill your needs.

Hi xorph I know that we can acess functions as you hv specified. But here i wanna more than one record to be returned on to the main form when selected in subform. thanx cheers MK

Well, I guess then you could write a function in the subform that returns a record variable which holds (=filters on) these selected records, e.g. using record marks and setting MARKEDONLY on the return record.

Hi xorph thanks for your suggestions i have done it. thanx kumar