General information
Category:
Forms & Form designer
Title:
Adding New Records In A Grid
I'm trying to add new records in a grid using the down arrow. I have put the following code in the KeyPress method of my Grid1.Column1.TextBox
nKeyCode = InKey()
If nKeyCode = 24
Insert Into GridTable(parent_id, otherparent_id) Values (Parent.parent_id, OtherParent.otherparent_id)
ThisForm.Refresh
EndIf
A new record is added to the GridTable but the parent_id fields are not entered therefore the relationship isn't preserved. How can I get a new record to be added with the apporpriate parent_id's using the down arrow? When I use similar coding with an add button I have no problems. BTW I do have the AddNew Method of the grid set to true. Am I not using the KeyPress method correctly?
TIA
--lincoln
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only