Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to 'rerun' SQL statement Record Source?
Message
From
05/08/1998 11:51:53
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/08/1998 11:45:14
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:
00124123
Views:
25
>>>Hi all,
>>>
>>>I've got a dropdown list whose recordsource is a SQL statement (type 3). It creates a cursor (contact names) which is used for the list. I'm allowing the users to enter another form to add a new contact.
>>>
>>>What I need to do is once they've added a new record in my table being used in the SQL statement and return to the main form, is 'rerun' the SQL statement in the recordsource to update the list.
>>>
>>>Where/how can I do this??
>>>
>>>mtia!
>>>
>>>Mandy
>>Mandy,
>>After new entry call ...mylist.requery
>>cetin
>
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform