Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Nadeem Shah
  Where is Nadeem Shah?
 Rawalpindi
 Pakistan
 Nadeem Shah
 Tags
Subject: RE: Append blank
Thread ID: 143179 Message ID: 143322 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Monday, August 27, 2007 9:00:46 PM         
   


> >
> > What is the relation between setting a focus and having at least one record? Are you talking about a grid control? If so then:
> >
> > insert into myGridrecordsource (...) values (...)
> > thisform.myGrid.refresh
> >
> > "Record is out of range" is hard to reproduce. Sometimes it may be related to an external index that is not updated, sometimes due to changes in grid rowheight at run time vice versa.
> >
> > Cetin Basoz
>
> Hi Cetin
> There is no relation. I just put text boxes over form and their control source is table field. I am directly appending the record over text boxes.
>
> first field, i just set focus that field and start data entry. If table is empty then set focus is not enable(cursor is lost) then i click my cursor over first text field then that text box enable.
> But after one record add, there is no problem.
>
> Nadeem Iqbal

So again, where is the problem. If the table is empty there is no row that you could set focus to, no? If you want to set focus independantly table has a row or not, you can remove controlsources or set the controlsources to an object represenation of the record. ie:

select myTable
scatter name thisform.oRecord blank

* Some textbox representing Company field
.Controlsource = "thisform.oRecord.Company"

Generally the preferred method is buffering. You can add a record in response to "Add" button and tablerevert() if you don't want to save.

Cetin Basoz

ENTIRE THREAD

Append blank Posted by Syed Nadeem Iqbal @ 8/25/2007 7:11:25 PM
RE: Append blank Posted by Don Higgins @ 8/25/2007 7:34:10 PM
RE: Append blank Posted by Marcia Akins @ 8/25/2007 9:18:33 PM
RE: Append blank Posted by Don Higgins @ 8/26/2007 1:11:24 AM
RE: Append blank Posted by Borislav Borissov @ 8/25/2007 9:24:35 PM
RE: Append blank Posted by Cetin Basoz @ 8/27/2007 11:49:23 AM
RE: Append blank Posted by Syed Nadeem Iqbal @ 8/27/2007 8:01:18 PM
RE: Append blank Posted by Cetin Basoz @ 8/27/2007 9:00:46 PM
RE: Append blank Posted by Syed Nadeem Iqbal @ 8/28/2007 6:42:07 PM