Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to 'rerun' SQL statement Record Source?
Message
From
05/08/1998 13:46:56
Mandy Mccord
Public Interest Breakthroughs, Inc.
Albany, New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00124108
Message ID:
00124166
Views:
28
>>...
>>>>Hi Cetin,
>>>>
>>>>I'm not sure where I do this. More info... I've got an "Add a new contact" button on FORM1 that calls FORM2 where the user adds a new contact record. Then FORM2's Save button releases FORM2, returning to FORM1. They're now back on my FORM1 with the dropdown lists having SQL statements querying CONTACTS.DBF as recordsources, one of which is named 'cmbATName' for example.
>>>>
>>>>Where do I run the requery? Sorry to be a pain ;)
>>>>
>>>>Mandy
>>>Mandy,
>>>First of all never a pain. Many ways and places to do it in fact but for your detailed case it could be like this :
>>>
* Button.click (calling form2)
>>>..
>>>do form form2  && New contact added
>>>thisform.cmbATName.requery() && refresh list on return
Cetin
>>
>>I tried this by putting the following code in my FORM1 'Add a new contact' button's Click method:
>>
>>DO FORM addcont
>>*!* refresh lists on return
>>thisform.pfAgyCont.pContacts1.cmbATname.requery()
>>thisform.pfAgyCont.pContacts1.cmbCOname.requery()
>>thisform.pfAgyCont.pContacts1.cmbCPCname.requery()
>>
>>But the lists aren't being refreshed until I close the form and open it again. Any ideas where I can look to make this work? Never easy! ;) And I really appreciate your willingness to help!
>>
>>Mandy
>
>Mandy,
>
>Try adding the statement
>
>thisform.pfAgyCont.pContacts1.Refresh()
>
>after your last Requery() statement to refresh the page on your pageframe. You *may* need to refresh each list separately, but I don't think so.
>
>As an aside, you may find this style of coding executes faster:
>
>WITH thisform.pfAgyCont.pContacts1
> .cmbATname.requery()
> .cmbCOname.requery()
> .cmbCPname.requery()
> .Refresh()
>
>ENDWITH && thisform.pfAgyCont.pContacts1
>
>Let us know if this helps...

Evan,

No luck. I tried adding the form refresh line and substituting my code with your WITH..ENDWITH code (neat tip, thanks!) and my lists are still not refreshing until I close/open the form. Ugh!

Mandy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform