Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid - Toolbar - Addnew

Status
Not open for further replies.

Knutjo

Programmer
Jan 15, 2002
31
0
0
NO
I have a form with a DataGrid connected to a Access 2000 database with a ADO-object. In the same form I have a toolbar with som buttons. One button is ment for "adding a new record" into the datagrid.

When I push the button in the toolbar I want to set focus on the last line in the datagrid where you normally register new reords.

I have tried to set the col,row properties, .Addnew etc, but with no luck.

Can anyone tell me how that VB code will look like ?


Regards
Knut
 
Give this a try...

Adodc1.Recordset.AddNew
dgName.SetFocus

HTH
Binky ::)
 
Thanks binky, but I have tried that and it doesn't help.

Those commands are adding a new blank line at the end, but before that line used for registering new records (the line marked with a '*'). If I use your commands I don't get the event "OnAddNew" which I use to set some default values when registering a new record.

I'm sure there is a solution...... but I haven't found it yet


Regards
Knut
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top