×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Refresh is not working
4

Refresh is not working

Refresh is not working

(OP)
I am using ThisForm.Refresh(), but my fields on the form are not being enabled.

I am setting all of my fields to .enabled = .T., however, when I do ThisForm.Refresh(), the fields are not enabled.  

The syntax that I have in Refresh are:

CLEAR TYPEAHEAD
SELECT csrHelpdesk
IF RECCOUNT() < 1
   THISFORM.olecontrol1.BtEnabled(2) = .F.
ENDIF

What's wrong with my form?

RE: Refresh is not working

Are the fields bound to data?  Is there a record in the table/view they are bound to?

RE: Refresh is not working

(OP)
Yes, the fields are bound to a cursor.  I am trying to blank out all fields in order to add a "NEW" record.

RE: Refresh is not working

Many OLE controls need an extra qualification ("object") for some properties and/or methods, try:

THISFORM.olecontrol1.object.BtEnabled(2) = .F.

Rick

RE: Refresh is not working

If they bound, when you do an append blank they will refresh and look enabled.  If you are at eof or the cursor is empty they will look disabled even if they are set to enabled.

RE: Refresh is not working

(OP)
*****  The problem is they are BOUND to a CURSOR and you CANNOT UPDATE a Cursor.  

Any suggestions?

RE: Refresh is not working

Then how/why are you doing data entry.   Either bind the fields to a table or a view.  Or you could use the cursor again which would allow you to update the cursor, for all the good it would do since the cursor is not tied to anything.

RE: Refresh is not working

(OP)
This application used to use Remote Views and now I have to remove the Remote Views, so I'm trying to do the best I can without dramatically changing the code.




RE: Refresh is not working

The else condition in the refresh method may solve the problem.

CLEAR TYPEAHEAD
SELECT csrHelpdesk
IF RECCOUNT() < 1
   THISFORM.olecontrol1.BtEnabled(2) = .F.
ELSE
   THISFORM.olecontrol1.BtEnabled(2) = .T.
ENDIF

ramani
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com

RE: Refresh is not working

OK, I'll bite.  What is the back end?  Why did you stop using remote views.  If you switched to VFP tables why are you not using local views?  If someone told you to stop using remote views because of performance issues, and is having you switch to sql passthru, first get a big 2x4 ...

RE: Refresh is not working

(OP)
The back end is SQL 2000.  The reason for discontinuing the use of remote views is because if any field or table is changed, the remote views are messed up and this causes more work.  

So, instead we are bringing the data into a cursor and upon updating the information, we update the SQL database.

Is this not the best solution?

RE: Refresh is not working

So, instead we are bringing the data into a cursor and upon updating the information, we update the SQL database.

I'm a bit confused.  To update the SQL database when you've changed the underlying table or field, you're going to have to make the same change you'd have to make to the remote view aren't you?  You can always create the remote view in code.  So just drop the old view and recreate the view using whatever changes are necessary.  You can cut and paste a lot of the code.  Just right click in the view designer and select view SQL to get the select statement for instance.  

Dave Dardinger

RE: Refresh is not working

Hi!

As about remote views - they are messed up just because they're based on the query like 'SELECT * FROM ...'. Of course, when new field added, such query returns another record set, thus view is messed. When you use a fields list in the SELECT statement, this problems goes away. Just change the order of field in the fields list in the view designer. this will change the view's query to use fields list instead. Of course, if you want to use new field in the vaie, you require to change the view (but not re-create it).
Many people use Remote Views...
A lot of people store view queries in the table and re-create the if needed using CREATE SQL VIEW command and DBSETPROP function to make it updatable. This is not such a big problem, indeed.

Hope this helps.


Vlad Grynchyshyn
vgryn@softserve.lviv.ua
http://www.softservecom.com
The professional level of programmer could be determined by level of stupidity of his/her bugs

RE: Refresh is not working

Go back to views.  The amount of code you are going to write to avoid using them is much greater than the problem with the remote views getting messed up.  Try to avoid views that do a select *.  There is also a program around called genview which will generate code from the view in the dbc.  I use it a lot to recover a view that has gotten wierd.  You should be able to download it from one of the vfp shareware sites.  If not contact me and I will email it to you.

RE: Refresh is not working

Have you tried simply putting This.Refresh() in the active event on your page

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close