PDA

View Full Version : ListBox is not accessable from different forms



Ruslan
12-10-2008, 12:57 AM
Hi there GURU's!

I have "mainFORM" with ListBox on it, and i have "addFROM" with textfields and "addBTN".
Problem:
when i press the "addBTN" on "addFORM" i want to insert a record to ListBox on "mainFORM" and it works perfect and then i want to requery the ListBox. The command ListBox.requery is not working from "addFORM".

How can i make it accessable?

Regards,
Ruslan

OBP
12-10-2008, 04:45 AM
Ruslan include the Mainform in the code by using the Parent property
me.parent.listbox.requery

Ruslan
12-10-2008, 05:39 AM
Hi OBP!
That code could help only if "addFORM" would be as "mainFORM" subform.
In my case there absolutely 2 different forms (created separately). "addFORM" do not see any of controls of "mainFORM".
PS! these forms are in the same application.

Any Suggestions?

Best Regards,
Ruslan

OBP
12-10-2008, 06:15 AM
Try
forms![mainform]![listbox].requery
or even
forms![mainform].requery
to requery the whole form

Ruslan
12-10-2008, 06:25 AM
:clap: OBP!!!!
You solved my problems!

Thank You very much, that was just what the doctor ordered :)

Best Regards,
Ruslan