Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Record Source Problem
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Grid Record Source Problem
Miscellaneous
Thread ID:
00124705
Message ID:
00124705
Views:
52
I have a form that accepts a parameter that is used in a select sql statement that in turn loads a grid. ie:

Form Init:

PARAMETERS pcGuestNumber
LOCAL lmAlias

lmAlias = alias()

this.grid1.recordsource = ''
select * from bills;
where gnum = &pcGuestNumber;
order by gnum into cursor billcurs
this.grid1.recordsource = 'billcurs'

if !empty(lmAlias)
select &lmAlias
endif

The error is "Cannot find variable pcGuestNumber" but if I comment out
the line that sets the recordsource of the grid, there is no error and the cursor is available just like it should be. gnum is a regular index, not unique. The recordsourcetype is set to alias. Do I have to index the cursor after the query? It seems to me the cursor should already be ordered and should not require an index to populate the grid? I've run into this before but I still don't understand this error.

Eric K.
Next
Reply
Map
View

Click here to load this message in the networking platform