FoxPro/Find and then add data
When I click on find button to find a record, it finds the record and displays it properly in the form (text box, combo etc).
If i then add a record, the form does not display the newly added record. instead it displays the previous record that I found by clicking find button.
I am using control set in the text property. I am wondering why the table displays the previous search record instead of displying the last added record.
Hi, welcome back!
I don't have near enough information to be able to give you a direct answer here. But, I can give you some things to look at:
1) How did you get from "Find" to "Add" - if you just typed the new information on top of the record you found, you could have overwritten it.
2) Are you sure the new record is actually being added to the table?
3) Where do the fields on the form (text, combo, etc) get their information? i.e. What's their control source? (table.field or m.variable?)
4) If all the objects point directly to the table (ControlSource= table.field), AND you are sure the data is added to a new record, it may require nothing more than moving the record pointer and refreshing the form. The easiest way to get to do this is:
(NOTE: If the table has an active index, GO BOTTOM goes to the last indexed record, not necessarily the last record in the table.)
If you are using "INSERT INTO" to add the new record this (#4) is more likely. If you "APPEND BLANK" then populate the fields in the new record, the pointer will already be moved.
If this doesn't help, and you have more information available, please send a follow-up.