AddNew in Navigation Bar - want to autofill data in bound fields.

I'm pretty new to vb.net and very new to 2005, so feel free to answers in begginer language...

I need to autofill a field on a data entry form when i click the "addnew" button on the Navigation Bar. (The one that is automatically generated by 2005 when I add the data source grid/fields to a form. (I have both the grid and data fields on the form becuase I want to see all records for one customer as I enter new records for him.) I've tried doing it by entering this code:

Room_CustomerTextBox.Text = custStr

in this routine:

Private Sub BindingNavigatorAddNewItem_Click

(custStr is a global field containing the value that should autofill in this field for every record added for that customer)

This code works fine when attached to a button I click after I click Addnew. But, when left only in the addnewitem_click function, the room_customertextbox is blank. So, I guess the routine in performed before it is re-bound to the fields (excuse my probably incorrect terminolgy) as it is being wiped out when the fields are all wiped out for the new record...

How can I make this autofill a part of the addnew click and avoid having to do it from it's own button

Thanks!



Answer this question

AddNew in Navigation Bar - want to autofill data in bound fields.

  • AddNew in Navigation Bar - want to autofill data in bound fields.