Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple uses of a form
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00012739
Message ID:
00012807
Views:
28
>I'm using a form to browse and create records.
>the browse works fine, however the create is
>having problems.
>I have the code to create a record in a menu
>command button since I use this form for two
>purposes.
>When I create a record the record appends to the
>database, a field is updated with a new value, but
>the remaining fields show info for the first record
>in the database instead of blanking.
>Refresh does not seem to work, it's as if the objects
>in the form will not refresh. they do when they are
>accessed, but not on refresh of the form.
>If I place the code within the form it runs fine.
>Does modal or modeless effect this situation?

I have had various problems with form behavior that sounds similar to what you are experiencing. If code is triggered from outside the form (e.g., from a menu) that significantly affects the dispaly of the form, I sometimes get strange behavior with how and when it refreshes. You might try this, it has worked for me sometimes:

Put "ThisForm.Refresh" in the GotFocus event of the form; then, in the section of code that adds the record, finish it up by calling the SetFocus method of the form. For some reason, Refresh seems to not work in some cases, if the form doesn't have focus when it's called. I don't understand it very well, but this workaround has fixed it for me on a few occasions.

Mark Peter
=========================
Mark A. Peter
Los Angeles, CA
mpeter@primenet.com
=========================
Previous
Reply
Map
View

Click here to load this message in the networking platform