Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Whenever I use the following statem

Status
Not open for further replies.

Octagon6

Programmer
Mar 18, 2003
18
US
Whenever I use the following statement, a stupid window pops up with the query results. How access the record w/o having the window pop up?

SELECT * FROM mileage WHERE mileage.ref_id = cur_ref_id

WITH thisform
.txtdr_miles.value= miles
.txtpu_city.value= origin
.txtdr_city.value= destination
ENDWITH
 
Hi Octagon6,

a window pops up showing the result of your query, right? How about storing the result of your query in a cursor, that way it wont show, but you can treat the cursor as a table.

SELECT * FROM mileage WHERE mileage.ref_id = cur_ref_id into cursor cursor1
 
try adding "INTO" into the statement
e.g
SELECT * FROM mileage into cursor curResults WHERE mileage.ref_id = cur_ref_id

you then have A cursor which contains the results of the sql

you can also into an array or table

as for your text boxes - make their controlsource the resultant cursor

WITH thisform
.txtdr_miles.value= curresult.miles
.txtpu_city.value= curresult.origin
.txtdr_city.value= curresult.destination
ENDWITH

but you may get more than 1 record returned from the statement.

also the cursor may not exist as the controls initialise unless you create it in the form init

you've got something to go on with at least

MrF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top