Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameterized query dialog
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00330308
Message ID:
00330371
Vues:
15
>SELECT Co_location.location_id, Co_location.cl_address,;
> Co_location.cl_city, Co_location.cl_state, Co_location.cl_zip,;
> Co_location.cl_country, Co_location.cl_date_turned_up,;
> Co_location.cl_cabinets, Co_location.cl_racks, Co_location.cl_voicet1,;
> Co_location.cl_sovereigns;
> FROM dbo.Co_Location Co_location;
> WHERE Co_location.cl_city = ?city
>
>This is what it used to look like, so that the box would pop up and ask them what they would want to view based on city.

Okay, building on the code in the earlier post, here's how you might want to handle this. Since I don't know the view name or the form name, you'll need to substitute those names in their appropriate places:
PROCEDURE GetLocationInfo

LOCAL City
City = ""

*-- Get the desired city value from the user,
*-- using our form with the desired title
*-- NOTE: This form -must- be modal (WindowType = 1)
*-- NOTE: This form -must- RETURN the desired value
*--       of City in its Unload() event
DO FORM MyForm ;
  TO City

*-- If the City value is not blank,
*-- get the location information
IF !EMPTY( City )
  = REQUERY( "MyView" )

ENDIF && !EMPTY( City )

ENDPROC && GetLocationInfo
Now, whenever you need to query the view, just "DO GetLocationInfo" (without the quotes, of course) and, assuming the user has provided a city, the view will be updated based on the desired value of City. If any controls on another form have their RecordSource as this view, you may need to Refresh() those controls as well.
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform