2 Replies - 11720 Views - Last Post: 31 May 2009 - 06:44 AM Rate Topic: -----

#1 The.Reaker.  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 10-April 09

'Next' button to navagate records

Posted 30 May 2009 - 09:52 PM

Hello everyone,
I hope all is good with everyone at dream in code!
Well anyways, I have been working on database programming alot over the last few weeks, and up tell the last few days I feel like no progress has been made. I didnt understand how to use the databinding features included in Visual Studio 2008 and had a hard time hard coding. It has been making much more sense but the only book I have found thus far to be extremely helpful is a VB 2005 book. I have the database connected and displaying the records, but cant get the next and previous button working correctly (I got rid of the navigator that automatically gets added when you add a new data source, and am trying to code my own buttons). The book instructed me to create a currencyManager, and I declared it CurrManager in my code.

CurrManager = Me.BindingContext(DsCompactDiscs, "tblCompactDiscs")


this is what I coded for the CurrManager and the following is the code for the next button.....

 If CurrManager.Position < (CurrManager.Count - 1) Then
			CurrManager.Position += 1
		Else
			MessageBox.Show("No more records.")
		End If



I can click next all over and over again, and once it reaches the end it gives me the message i wanted it too, it just doesnt update the textbox with the next records data.

Any help would be appreciated!

Thanks,
Andrew

Is This A Good Question/Topic? 0
  • +

Replies To: 'Next' button to navagate records

#2 Damage  Icon User is offline

  • Lord of Schwing
  • member icon

Reputation: 56
  • View blog
  • Posts: 1,215
  • Joined: 05-June 08

Re: 'Next' button to navagate records

Posted 30 May 2009 - 11:17 PM

i'm not following. You click the button and the next record gets displayed. That right?
And what you want is to update the table with some data when there are no more records in the table?
Was This Post Helpful? 0
  • +
  • -

#3 The.Reaker.  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 10-April 09

Re: 'Next' button to navagate records

Posted 31 May 2009 - 06:44 AM

Im sorry if I did not word it clearly before, it was a late night last night!

Well I am trying to code a Next and a Previous button to change the records that are displayed.

The code I put in the previous post was what I used to code the 'next' button, but when I run the program and hit it nothing seems to happen. However when it is running and I continue to hit the button it will cycle through all the records (im assuming this because it is not changing the text displayed in the text boxes), it then will show the msgbox that there are no more records (this is what leads me to think that it is cycling through the records, and just not updating the text).

I want it to change the record and the text displayed when I hit the next button, and that is where I'm confused as far as what to do next.

Thanks!
.The.Reaker.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1