Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need serious help with buffering
Message
From
29/06/1998 19:32:21
 
 
To
29/06/1998 18:07:52
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00112693
Message ID:
00112713
Views:
14
>I am getting lost with buffering and I cannot find any source that explains what is happening.
>
>I have a form with optimistic row buffering and I'm working off of one table. A simple data entry for customers, here is what happens:
>
>Form comes up fine. I hit the "lookup" button and I'm put on the customer number txtbox. I enter a value, my lookup displays a pick list, I select the customer, the browse list closes, I move the pointer in the customer table to the appropriate record and say thisform.refresh. All the txtboxes are now blank and so are the fields in the table !!!! No tableupdate() was issued. Here is how it looks:
>
>*-- Current work area is "customer"
>USE customer ALIAS a_cust IN 0 AGAIN
>
>*-- Note: I have a custom lookup program that always opens the lookup table AGAIN in another work area.
>
>SELECT a_cust
>
>IF !SEEK(this.value, 'a_cust')
> *-- Ask them to list or reenter
>ELSE
> *-- Value found
> this.value = a_cust->custno
> USE IN a_cust
> SELECT customer
> SEEK this.value
> *-- Everything is fine up to here
> thisform.refresh
>ENDIF
>
>What I now see on the screen is blank txtboxes and when I look in thne table, every field is blank. The only time I don't get th efields blanked is if I disconnect the controlsource of each txtbox before doing the lookup and then reassigning it after the value is picked from the pick list. I know this isn't how it's supposed to be done.
>
>I've got tons of VFP books and nothing really tells me what is going on with the buffering and how I could possibly update my data while using optimistic buffering.
>
>Any clue as to what to do or what to read ??????


I assume that the controlsources of your textboxes are set to customer? And you SEEK a value in customer, refresh, and the textoxes are empty? Are they disabled also? Have you checked for EOF() What it sounds like to me is that your seek is failing, and the record pointer is sitting at EOF() and yhe textboxes have nothing to show. Instead of the SEEK command, try the seek function, and check the return value;

recordfound = SEEK(this.value,'customer','custno')

Substitute 'custno' for your tag name.

You could also tell a lot in the debugger by putting EOF('customer') in the watch window. If it evaluates to .F., then check the value of one of the fields in the cursor. Is it empty?

In short, I don't think your problem is necessarily a buffering one, but a matter of your textboxes looking at the right cursor and your cursor sitting on the right record.

IMHO, the VFP manual does a very good job of explaining buffering. I am always surprised at how much I learn every time I just go back and flip through it.

Good luck, and let me know if you get it figured out.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform