473,787 Members | 2,932 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scrolling using ADHOC Bar!

I’ve used the following code to bind the data from an access database
to text boxes in Windows Form in VB.Net. Now I want to be able to
scroll through the records using a adhoc bar and be able to jump from
the first to the last record. this coding only displays the first
record. Can anyone please help me?

Private Sub frmmemberdetail s_Load(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles MyBase.Load
Me.OpenConnecti on()
Me.BindToTextbo x()
End Sub

Public Sub OpenConnection( )

Dim strPath As String = "C:\db1.mdb "
Dim strConnectionSt ring As String =
"Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & strPath

Dim objOleDbConnect ion As New
OleDbConnection (strConnectionS tring)

objOleDbConnect ion.Open()

Me._AmarsConnec tion = objOleDbConnect ion

End Sub

Public Sub BindToTextbox()
Dim strQuery As String = "SELECT * FROM [MemberDetails];"

Dim objOleDbCommand As New OleDbCommand(st rQuery,
_AmarsConnectio n)

Dim objOleDbDataAda pter As New
OleDbDataAdapte r(objOleDbComma nd)

Dim objDataTable As New DataTable()

Try

objOleDbDataAda pter.Fill(objDa taTable)
Me.txtmemberid. DataBindings.Ad d(New Binding("Text",
objDataTable, "MemberID") )
Me.txtfirstname .DataBindings.A dd(New Binding("Text",
objDataTable, "FirstName" ))
Me.txtlastname. DataBindings.Ad d(New Binding("Text",
objDataTable, "LastName") )
Me.txthouseno.D ataBindings.Add (New Binding("Text",
objDataTable, "HouseNumbe r/Name"))
Me.txtstreetnam e.DataBindings. Add(New Binding("Text",
objDataTable, "StreetName "))
Me.txtarea.Data Bindings.Add(Ne w Binding("Text",
objDataTable, "Town"))
'city combobox
Me.txtpostcode. DataBindings.Ad d(New Binding("Text",
objDataTable, "PostCode") )
Me.txtemail.Dat aBindings.Add(N ew Binding("Text",
objDataTable, "MemberE-mail"))
Me.txthomeno.Da taBindings.Add( New Binding("Text",
objDataTable, "HomeTel"))
Me.txtmobile.Da taBindings.Add( New Binding("Text",
objDataTable, "MobileNumber") )
Me.txtdob.DataB indings.Add(New Binding("Text",
objDataTable, "DateOfBirt h"))
Me.txtdatejoine d.DataBindings. Add(New Binding("Text",
objDataTable, "DateJoined "))
Me.txtkinname.D ataBindings.Add (New Binding("Text",
objDataTable, "NextOfKin-Name"))
Me.txtkinno.Dat aBindings.Add(N ew Binding("Text",
objDataTable, "NextOfKin-Tel"))
Catch ex As Exception
Me.ComboBox1.Te xt = ex.Message.ToSt ring()
Finally
Me.CloseConnect ion()
End Try

End Sub

Sub CloseConnection ()
_AmarsConnectio n.Close()
End Sub
End Class

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #1
1 1172
Hi,

Take a look at the currencymanager class
http://msdn.microsoft.com/library/de...classtopic.asp

Ken
----------------------
"InBigTroub le" <vi*****@hotmai l-dot-com.no-spam.invalid> wrote in message
news:40******** **@127.0.0.1...
I’ve used the following code to bind the data from an access database
to text boxes in Windows Form in VB.Net. Now I want to be able to
scroll through the records using a adhoc bar and be able to jump from
the first to the last record. this coding only displays the first
record. Can anyone please help me?

Private Sub frmmemberdetail s_Load(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles MyBase.Load
Me.OpenConnecti on()
Me.BindToTextbo x()
End Sub

Public Sub OpenConnection( )

Dim strPath As String = "C:\db1.mdb "
Dim strConnectionSt ring As String =
"Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & strPath

Dim objOleDbConnect ion As New
OleDbConnection (strConnectionS tring)

objOleDbConnect ion.Open()

Me._AmarsConnec tion = objOleDbConnect ion

End Sub

Public Sub BindToTextbox()
Dim strQuery As String = "SELECT * FROM [MemberDetails];"

Dim objOleDbCommand As New OleDbCommand(st rQuery,
_AmarsConnectio n)

Dim objOleDbDataAda pter As New
OleDbDataAdapte r(objOleDbComma nd)

Dim objDataTable As New DataTable()

Try

objOleDbDataAda pter.Fill(objDa taTable)
Me.txtmemberid. DataBindings.Ad d(New Binding("Text",
objDataTable, "MemberID") )
Me.txtfirstname .DataBindings.A dd(New Binding("Text",
objDataTable, "FirstName" ))
Me.txtlastname. DataBindings.Ad d(New Binding("Text",
objDataTable, "LastName") )
Me.txthouseno.D ataBindings.Add (New Binding("Text",
objDataTable, "HouseNumbe r/Name"))
Me.txtstreetnam e.DataBindings. Add(New Binding("Text",
objDataTable, "StreetName "))
Me.txtarea.Data Bindings.Add(Ne w Binding("Text",
objDataTable, "Town"))
'city combobox
Me.txtpostcode. DataBindings.Ad d(New Binding("Text",
objDataTable, "PostCode") )
Me.txtemail.Dat aBindings.Add(N ew Binding("Text",
objDataTable, "MemberE-mail"))
Me.txthomeno.Da taBindings.Add( New Binding("Text",
objDataTable, "HomeTel"))
Me.txtmobile.Da taBindings.Add( New Binding("Text",
objDataTable, "MobileNumber") )
Me.txtdob.DataB indings.Add(New Binding("Text",
objDataTable, "DateOfBirt h"))
Me.txtdatejoine d.DataBindings. Add(New Binding("Text",
objDataTable, "DateJoined "))
Me.txtkinname.D ataBindings.Add (New Binding("Text",
objDataTable, "NextOfKin-Name"))
Me.txtkinno.Dat aBindings.Add(N ew Binding("Text",
objDataTable, "NextOfKin-Tel"))
Catch ex As Exception
Me.ComboBox1.Te xt = ex.Message.ToSt ring()
Finally
Me.CloseConnect ion()
End Try

End Sub

Sub CloseConnection ()
_AmarsConnectio n.Close()
End Sub
End Class

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet
News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000
Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1614
by: Donald Firesmith | last post by:
I am using Framesets (www.donald-firesmith.com, left primary navigation frame, soon to be xhtml) using: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> I want to enable vertical scrolling, but prohibit horizontal scrolling. There doesn't seem to be a way of doing this. I want to get rid of the unnecessary...
1
7025
by: Kirk | last post by:
Is it possible to stop horizontal scrolling whilst still maintaining vertical scrolling within an <IFRAME> ? Within each page of my site I have an IFRAME for content. For some pages there is very little information to display, thus the frame has no scrolling bars, but on those where there is lots then the vertical scrolling bar appears. However, on two of my pages the horizontal scrolling bar has appeared also - why!? I'm just...
3
3687
by: Scott M | last post by:
Hi, I am currently trying to write a simple game using vb.net the form I am working on is 800*600 (this is set as the maximum size) and autoscroll is set to true. The user moves around the screen by moving a picturebox (sprite) with the cursor keys. When the user hits the bottom of the screen I want the screen to automatically scroll down to keep the picture box in view - The screen
13
7298
by: al jones | last post by:
I guess one question at a time will work better. URL http://aljones.us (yes, I'm back again) I'd like to cause this whole page to fill the viewable window if I can. Meaning that I'd like the entire page to be visible on the current users screen. That means that I'd like one or both of the divs to scroll. I've found how to do that, I think, but can't seem to 'size' the page so it fits on
0
1274
by: Aku | last post by:
Hello, I have a RichTextBox located in a TabPage area; when I enter the RTBox space I displayed a certain text on it (using MouseEnter event). When I leave the RTBox space I displayed another (default-) text (using MouseLeave event). The problem: when entering the space, the text length is of such length that a VerticalScroll bar pops up. When I tried to scroll down by clicking on the bar or just touch the scroll bar, the displayed text...
0
1470
by: Scott M | last post by:
Hi, I am currently trying to write a simple game using vb.net the form I am working on is 800*600 (this is set as the maximum size) and autoscroll is set to true. The user moves around the screen by moving a picturebox (sprite) with the cursor keys. When the user hits the bottom of the screen I want the screen to automatically scroll down to keep the picture box in view - The screen
2
4229
by: Eduard | last post by:
I have a ASP.Net datagrid wrap in the following div: <DIV id="divPart2" style="OVERFLOW: hidden">. Another div controls the horizontal scrolling: <DIV id="scroll1" style="OVERFLOW: scroll; WIDTH: 800px; LINE-HEIGHT: 0px; HEIGHT: 17px" onscroll="javascript: document.getElementById('divPart2').scrollLeft = this.scrollLeft;"> scrolls the datagrid horizontally. When the horizontal scroll box is dragged or any of the scrollbar arrows is
11
7655
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I know I sound like a one-note Johnny on this but I'm still looking for a solution. I need to display characters coming in from a serial port or a socket. I also need to be able to type characters into the display myself - but that's not the main issue at this time. I've tried a scrolling multiline text box but once the original viewable area fills up and it starts scrolling the flashing of the entire area drives me nuts. The...
7
5768
by: Kevin Wilcox | last post by:
Hi I'm trying to emulate, within access, the gantt chart timeline / task planner aspects of ms project. Creating the chart on the form has been easy enough; I use a series of unbound text boxes in the header to show the week numbers, with correlating unbound text boxes in the detail section of a continuous form to calculate a series of values for each task which, where these match the value in the header text box will change the colour of the...
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.