Link to home
Start Free TrialLog in
Avatar of taz8020
taz8020Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Open form in addnew record mode vb.net win form

Hi this should be quite simple
I have form1 with a datagrid. At the moment when someone clicks on a cell on datagrid view it filters a form2 then opens it. which works great.

However I now want a button to add a new product. So I  instead of using filter the form I want it to go to the add new record,
basically just do the same thing as clicking on the yellow cross in the navigation bar but in code
Avatar of 13598
13598
Flag of United States of America image

bindingsource.addnew ?
Avatar of taz8020

ASKER

Hi 13598
I tried productsbindingsource.addnew but just went to the first record. do you no why this would this happen.
Could you put it in a try/catch statement and see if it gives you a clue, as in:
try
 productsbindingsource.addnew
catch ex as exception
messagbox.show(ex.tostring)
end try
ASKER CERTIFIED SOLUTION
Avatar of 13598
13598
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of taz8020

ASKER

I cannot get over how many times i get stuck on something so simple, and i try every thing else. Thanks
You are welcome. We've all been there.I'm glad it was simple.