Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Edit and Add on same Form
Message
From
01/01/2001 09:07:07
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00457515
Message ID:
00458299
Views:
24
Hi Mark,

THanks for the reply. I was just trying to make sure that I deleted the correct record. I changed it to DELETE as I am only deleting the current record ie the one in the pview.

Do you have any ideas on the two drop down list boxes? The first one has all the companies in it and the second one contains a list of the contacts for the current company. They are both bound to the view by column 2 which contains the pk for each. Coulumn 1 contains the names. They are both populated with a SELECT in the .Activate for the page. The contact list box shows up blank after a delete... all other times it works fine. Even if I select another part from another company the contact list box shows the contacts from the previous company.... like its out of sync somehow....I gotta be missing something in this...

THis is the code I use to populate the arrays for the drop down list boxes
WITH This  && Form.PageFrame1.Page4
  * Customer Listbox
  SELECT ;
    Customer.CustName, Customer.CustId;
    FROM ShopTrack!Customer;
    ORDER BY Customer.CustName;
    INTO ARRAY .cboCustomer.laData
  IF _TALLY = 0
    DIMENSION .cboCustomer.laData[1,1]
    STORE "No Customers" TO .cboCustomer.laData
  ENDIF
  * Contact Listbox
  SELECT ;
    ALLTRIM(Contacts.LName) + ', ' + ALLTRIM(Contacts.FName) AS ContName,;
    Contacts.ContId;
    FROM ShopTrack!Contacts;
    WHERE Contacts.CustId = INT(VAL(.cboCustomer.List(.cboCustomer.ListIndex, 2)));
    ORDER BY ContName;
    INTO ARRAY .cboContact.laData
  IF _TALLY = 0
    DIMENSION .cboContact.laData[1,1]
    STORE "No Contacts" TO .cboContact.laData
  ENDIF
ENDWITH
THanks so much for your replys.



>Why are you doing a DELETE FOR? This scans the entire view and places the record pointer at EOF when finished. Since you are only updating the current record [your first parameter is ZERO], the update will fail. If you are just deleting the current record, just issue a DELETE [or DELETE NEXT 1] followed by the rest of your code.
>
>>Hi Mark,
>>
>>I am trying out your method and like it very much. I am having a problem when I delete a record. On the page is two drop down list boxes where I show the company and the contact for that record. When I delete a record the contact list box becomes empty when it should contain a name. If I tab around the screen two times it shows up. All other times this works as expected. The list boxes are both bound to the view.
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform