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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi all, I have a problem. I a

Status
Not open for further replies.

woodyinoz

IS-IT--Management
Jan 8, 2002
215
GB
Hi all,

I have a problem.

I am running a query upon a form that uses the following if statement:-

if USER12 = "INT1" then

Gdrno = USER1.value

WebMatch = Query

FinalRoute.db | USER1 | USER2 | Width |
| ~GdrNo | WEB | check |

endQuery

If not executeQBE(WebMatch,"WebMatch.db") then
errorshow()
endif

endif


As you can see this puts the width of all parts which meet the criteria in WebMatch.db. (This will always only be one value)
What I then need to do is read this value and use it in a formula upon the form. The problem I get is that I can't attach the WebMatch.db onto the form because it then tells me that the db is already in use.

Any ideas how I can do this?

Thanks,

Woody.
 
Hi
Try this
Dont attach the webmatch.db ( the query answer table) to the form...
Set up a variable (say V) in the form for the value you want to use and set it to 0
Run your query....then
Open a Tcursor in webmatch.db....
locate the record or read the record in Tcursor table
set your variable V = to the value in Tcursor table
Then use the varable V in you formula.

Hope this helps
 
You could also just fire the query result directly to a tcursor:

var
tcWidth tcursor
wArray array[] string ;only for example
jj longint ;only for example
endVar

;...define query, etc.

If not executeQBE(WebMatch, tcWidth) then
errorshow()
endif
;...

;e.g. put the results in to an array
for jj from 1 to tcWidth.nRecords()
wArray[jj] = tcWidth."Width"
endFor
tcWidth.close() ;destroy the tcursor to free up memory
wArray.view("Width Values")


HTH
Padraig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top