Jump to content

vb.net 2008 Data Bindings Question

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Danerd100

Danerd100

    Learning Programmer

  • Members
  • PipPipPip
  • 52 posts
Hi, I am new to programming using databases. I have an access database with 17 fields (one of them is a TRUE/FALSE field)
I have a form with 16 textboxes, and 1 checkbox (1 cbox for the t/f, 16 tboxes for others). I have all of the data bindings setup with the controls and the corresponding database fields.

My Question:
How do I make it so when I hit the "NEXT" button, it moves on to the next row (and if it is on the last row, it creates a new row) and displays the data in that row, and, how do I make it so when i hit the "SAVE" button, it saves the data back into the original row (edits the data)?

#2
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,675 posts
For the navigation button (next,previous,movelast,movenext) you can use this code:

'move to next field 

bindingsource.Move next()

-note that bindingsource stands for the name of the binding source connected to your controls
2.For the addnew button you can use this code

bindingsource.Addnew()

3.For the save or insert button you can use this code

tableadapter.Insert(textbox1.Text,textbox2.Text)

add textboxes that match the field
-reply if you need furthur help