Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order get messed up after append record
Message
From
19/09/2002 02:47:41
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russia
 
 
To
19/09/2002 01:44:27
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00702123
Message ID:
00702131
Views:
19
>I have this combo box in my form that I'm having trouble
>with when adding a new record. I am listing the following
>to help clarify the picture:
>
>1. In my table:
> table1 fields: serial_id (primary key)
> name (regular key)
> acc_code (regular key)
> ... and some other fields.
>
>2. data environment: buffer mode override = 1
> order : serial_id
>
>3. In my form:
> All 3 fields are combo boxes. cbserial_id, cbname, cbacc_code,
> rest of the fields are textboxes.
>
> cbserial_id: control source: table1.serial_id
> bound to: .T.
> rowsource: table1.serial_id,name,acc_code
> rowsource type: 6 - fields
> select on entry: .T.
> sorted: .F.
>
>4. The add record method in the form is fired from a pulldown menu
> in the form.


Try to use requery method for combo, instead of refresh after adding new record into table -source for combo
>
>5. Codes in my add record method:
> APPEND BLANK
> REPLACE serial_id WITH ALLTRIM(sNo)
> THISFORM.refresh
> WITH THISFORM.pageFrame1
> .ActivePage = 2
> .page2.txtremarks.SETFOCUS()
> ENDWITH
>
>Now the problem:
>The record pointer seems get messed up every time a record has
>been added.
>Symtoms:
>a. In adding a record, after all the details have been filled in
>and when the top button is pressed, the form shows the first
>record with a blank serial_id. Sometimes the name is blank
>instead.
>b. When the table is at the last record and pressing the next button
>again, instead of staying at the last rcord, it shows the second
>last record in the table.
>c. When traversing down the table from top to bottom, I can find the
>newly added record. When going up from the bottom record by record,
>i can't see the new record.
>
>Some things had definitely been done wrong here and i just can't sort
>it out. Setting buffer mode override to 3 wouldn't help. Setting
>thisform.cbserial_no.value = sNo instead of using the REPLACE command
>wouldn't either, There are a number of other things I've tried all to
>no avail.
>
>Help is much appreciated.
MVP-2006-2011, PHD in Math and Physics ,
host of www.foxclub.ru,
VFP lector at Interface and Microinform companies
Head science researcher of VNIIA Rosatom.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform