You are here:

FoxPro/Add items in grid1


Form Sample grid1
Form Sample grid1  
Hi Fred please see attached image to support my question.

How to add and items in a grid1 at the bottom. these items are from the textboxes i created once i press the enter key the date on these textboxes should be added in the grid1.

I am hoping you can help me....

Thanks best regards...


Hi Guilmar,

  Using the ENTER key can cause problems, if you press ENTER after typing the customer number, you'll end up with several blank fields.  I would recommend adding two buttons to your screen, one for ADD and another for EXIT.  That way you could make as many entries as you want before closing the form.  THISFORM.RELEASE in the EXIT button's click event is all you need.  

  Use the ADD button's click envent to actually add your data to the grid.  You'll need to update the source of the grid by adding the new record (a GRID source is usually a table).  After updating the source, reset all your text fields back to spaces.  Once the source is updated, refresh the form with THISFORM.REFRESH and set the focus back to your customer number field.  At that point, the grid should be populated and you're ready for another set of data.  


All Answers

Answers by Expert:

Ask Experts


Fred Frase


Questions about development only. No installation or hardware specific questions, please. Your first step in requesting assistance should be to identify the version of FoxPro you are using. I can write short functions but, PLEASE do not ask me to write programs for you.


Nearly 30 years professional programming experience using FoxPro (FoxBase through VFP 9) or other xbase language, primarily in Windows environments.

Completed a 1,000 hour diploma course in programming at International Academy of Ohio (subsequently merged with Southern Ohio College).

©2016 All rights reserved.