Click here to Skip to main content
15,881,248 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionTriplesDES error Pin
TheMrProgrammer20-Jul-09 7:10
TheMrProgrammer20-Jul-09 7:10 
AnswerRe: TriplesDES error Pin
Luc Pattyn20-Jul-09 7:54
sitebuilderLuc Pattyn20-Jul-09 7:54 
GeneralRe: TriplesDES error Pin
TheMrProgrammer20-Jul-09 21:07
TheMrProgrammer20-Jul-09 21:07 
GeneralRe: TriplesDES error Pin
Luc Pattyn21-Jul-09 1:41
sitebuilderLuc Pattyn21-Jul-09 1:41 
Questionhow to return dataadapter and data set from the same function Pin
hemrk20-Jul-09 6:08
hemrk20-Jul-09 6:08 
AnswerRe: how to return dataadapter and data set from the same function Pin
Christian Graus20-Jul-09 14:37
protectorChristian Graus20-Jul-09 14:37 
GeneralRe: how to return dataadapter and data set from the same function Pin
hemrk20-Jul-09 15:47
hemrk20-Jul-09 15:47 
Questionuseing .MovePrevious() etc Pin
StephenFinch20-Jul-09 2:31
StephenFinch20-Jul-09 2:31 
Hi Can someone please help, I am New to vb2005 Codeing so please be gentle.

Here is my code, I can only move forward or goto first but the .MovePrevious() and .Movelast()last give me an error.

Public Class Form1
Dim MyConnObj As New ADODB.Connection 'ADODB Connection Object
Dim myRecSet As New ADODB.Recordset 'Recordset Object
Dim sqlStr As String ' String variable to store sql command
Dim c As String
Dim tot As Long
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MyConnObj.Open( _
"Provider = sqloledb;" & _
"Data Source=LINK-2927;" & _
"Initial Catalog=Sage200_DemoData;" & _
"User ID=sa;" & _
"Password=link12?;")
sqlStr = "select * from SLCustomerAccount"
myRecSet.Open(sqlStr, MyConnObj)
TextBox1.Text = "" & myRecSet.Fields!CustomerAccountName.Value
TextBox2.Text = "" & myRecSet.Fields!CustomerAccountNumber.Value
myRecSet.MoveFirst()
End Sub
Private Sub NextButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NextButton.Click
With myRecSet
.MoveNext()
If .EOF() = False Then
TextBox1.Text = "" & myRecSet.Fields!CustomerAccountName.Value
TextBox2.Text = "" & myRecSet.Fields!CustomerAccountNumber.Value
Else
.MoveFirst()
TextBox1.Text = "" & myRecSet.Fields!CustomerAccountName.Value
TextBox2.Text = "" & myRecSet.Fields!CustomerAccountNumber.Value
End If
End With
End Sub
Private Sub LastButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LastButton.Click
With myRecSet
.MoveLast()
If .EOF() = False Then
TextBox1.Text = "" & myRecSet.Fields!CustomerAccountName.Value
TextBox2.Text = "" & myRecSet.Fields!CustomerAccountNumber.Value
Else
.MoveLast()
TextBox1.Text = "" & myRecSet.Fields!CustomerAccountName.Value
TextBox2.Text = "" & myRecSet.Fields!CustomerAccountNumber.Value
End If
End With
End Sub
Private Sub previousButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles previousButton.Click
With myRecSet
.MovePrevious()
If .EOF() = False Then
TextBox1.Text = "" & myRecSet.Fields!CustomerAccountName.Value
TextBox2.Text = "" & myRecSet.Fields!CustomerAccountNumber.Value
Else
.MoveFirst()
TextBox1.Text = "" & myRecSet.Fields!CustomerAccountName.Value
TextBox2.Text = "" & myRecSet.Fields!CustomerAccountNumber.Value
End If
End With
End Sub

Private Sub FirstButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FirstButton.Click
With myRecSet
.MoveFirst()
If .BOF() = False Then
TextBox1.Text = "" & myRecSet.Fields!CustomerAccountName.Value
TextBox2.Text = "" & myRecSet.Fields!CustomerAccountNumber.Value
Else
.MoveFirst()
TextBox1.Text = "" & myRecSet.Fields!CustomerAccountName.Value
TextBox2.Text = "" & myRecSet.Fields!CustomerAccountNumber.Value
End If
End With
End Sub
End Class




Help

Thanks
Stephen
AnswerRe: useing .MovePrevious() etc Pin
Johan Hakkesteegt20-Jul-09 2:48
Johan Hakkesteegt20-Jul-09 2:48 
GeneralRe: useing .MovePrevious() etc Pin
StephenFinch20-Jul-09 3:02
StephenFinch20-Jul-09 3:02 
QuestionValidating a cell in DataGrid Pin
rhtbhegade20-Jul-09 0:51
rhtbhegade20-Jul-09 0:51 
AnswerRe: Validating a cell in DataGrid Pin
Jay Royall20-Jul-09 1:02
Jay Royall20-Jul-09 1:02 
GeneralRe: Validating a cell in DataGrid Pin
rhtbhegade20-Jul-09 2:11
rhtbhegade20-Jul-09 2:11 
GeneralRe: Validating a cell in DataGrid Pin
Jay Royall20-Jul-09 2:27
Jay Royall20-Jul-09 2:27 
GeneralRe: Validating a cell in DataGrid Pin
rhtbhegade20-Jul-09 2:37
rhtbhegade20-Jul-09 2:37 
GeneralRe: Validating a cell in DataGrid Pin
Jay Royall20-Jul-09 2:48
Jay Royall20-Jul-09 2:48 
AnswerRe: Validating a cell in DataGrid Pin
dan!sh 20-Jul-09 1:02
professional dan!sh 20-Jul-09 1:02 
QuestionNeed help to add a VB shortcut(hotkey) key to function Pin
kaartikavin19-Jul-09 23:48
kaartikavin19-Jul-09 23:48 
AnswerRe: Need help to add a VB shortcut(hotkey) key to function Pin
nlarson1120-Jul-09 2:29
nlarson1120-Jul-09 2:29 
GeneralRe: Need help to add a VB shortcut(hotkey) key to function Pin
Dave Kreskowiak20-Jul-09 4:18
mveDave Kreskowiak20-Jul-09 4:18 
AnswerRe: Need help to add a VB shortcut(hotkey) key to function Pin
Dave Kreskowiak20-Jul-09 4:19
mveDave Kreskowiak20-Jul-09 4:19 
Questionhow to check is SQLServer2005 is installed on my m/c Pin
koolprasad200319-Jul-09 21:06
professionalkoolprasad200319-Jul-09 21:06 
AnswerRe: how to check is SQLServer2005 is installed on my m/c Pin
Vimalsoft(Pty) Ltd19-Jul-09 22:48
professionalVimalsoft(Pty) Ltd19-Jul-09 22:48 
QuestionUpgrade Failure? Pin
teknozwizard19-Jul-09 20:47
teknozwizard19-Jul-09 20:47 
AnswerRe: Upgrade Failure? Pin
Johan Hakkesteegt19-Jul-09 21:20
Johan Hakkesteegt19-Jul-09 21:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.