>I have a Grid Box With 4 columns
>The first column is stockid and then specie, grade , unitcost
>
>Questions:
>
>1) How to validate those fields are exist or not?
>
> I have try this:
>
> In the grid.beforerowcolchange
>
> With thisform.grid
> idkey=.cstock.combo1.value+cspecie.combo1.value+cgrade.combo1.value
> yesfound=seek(idkey,"stock",1) && (index key - stockid+specie+grade
> if !(yesfound)
> messagebox("Non-Existing Stock")
> else
> stor unitcost to .ccost.text1.value
> endi
> endwith
>
>Is this code correct??
Hi there,
Code looks ok but It would be better if you put this code into a saperate Method of the Form and call this Method from each Columns.Text.Valid() event and grid's Valid event as well. BeforeRowColChange() will not fire every time. e.g. if you click on 'Save' button outside the Grid.
BTH, Is there any spelling mistake in your name?
Bye
Jayesh
- Jayesh