Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
100k Rollover Bug
Message
From
23/01/2000 17:23:01
 
 
To
23/01/2000 11:09:16
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00321209
Message ID:
00321462
Views:
17
>Al, I'm having a tough time integrating a parameterized view into my order entry program.
>
>I've created a pv using test3.dbc as the container and ? nInvNo as the parameter in the view called view10
>
>In the onload method I include the following code:
>
>this.dataenvironment.cursor1.cursorsource="J:\DB\DATA\INVENTOR.DBF"
>this.dataenvironment.cursor2.cursorsource="J:\DB\DATA\INVOICE1.DBF"
>this.dataenvironment.cursor3.cursorsource="J:\DB\DATA\INVOICE2.DBF"
>this.dataenvironment.cursor4.cursorsource="J:\DB\DATA\MAILLIST.DBF"
>this.dataenvironment.cursor5.DATABASE"J:\VFP6\PHOTOEYE\FORMS\TEST3.DBC"
>
>When I add an item to the invoice2.dbf, I capture the invoice number by setting nInvNo=invoice1.invoice
>
>Then when I browse the view that resides in Test3.dbc, (I haven't gotten to the point of filling the grid yet) the buffered records are not there, nothing is! Yet when I use this view outside the form in a test case, it works fine on data that already resides in Invoice2. This is not sinking through yet. What am I missing? TIA.

Without looking at it too closely, I'd be inclined to set the view parameter directly to ?Invoice1.Invoice.

You also have to make sure you set the default value of the Invoice2.Invoice equal to Invoice1.Invoice for new records, or you'll find they won't match the view criteria and won't show up.

Also, do you have any particular reason why you're doing this in code? You can load a view in a DE just like a table.

Depending on what controls you use, you might have to issue .Requery() if you move the parent record pointer, in order to reload the view with the new appropriate values.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform