Hi,
I've build a label program in Visual Basic 6 about 2 years ago, everything works perfect with it but i lost my original VB files for editing the program and have decided to rebuild using VB.Net (MS VB Express 2008 Free).
The problems im having relate to a search box i had in one of my forms. Basically the form was connected to an Access DB which stored 3500+ details on serial numbers and location codes for items within a warehouse. When a user typed the serial number into the search box, clicked the search button all the details filled into label.captions on the form. The user would verify everything and maybe enter in a few more details on Textbox's before printing a nice little label. This was my VB Code for the search box:
Private Sub CmdSearch_Click()
txtpartno.Text = TxtSearch.Text
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
If opin Then
DataEnvironment1.rsCommand1.MoveFirst
DataEnvironment1.rsCommand1.Find ("[No] ='" & (TxtSearch.Text) & "'")
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
End If
If Opdes1 Then
DataEnvironment1.rsCommand1.MoveNext
DataEnvironment1.rsCommand1.Find ("[Description] ='" & (TxtSearch.Text) & "'")
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
End If
If Opdes2 Then
DataEnvironment1.rsCommand1.MoveNext
DataEnvironment1.rsCommand1.Find ("[Description 2] ='" & (TxtSearch.Text) & "'")
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
End If
If Opdes3 Then
DataEnvironment1.rsCommand1.MoveNext
DataEnvironment1.rsCommand1.Find ("[Description 3] ='" & (TxtSearch.Text) & "'")
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
End If
TxtLotR.Text = "PR-"
TxtLotR.SetFocus
End Sub
Problem i cant seem to get past is that .Find doesnt exist in VB.Net and the whole DataEnvironment has changed to a Datasource and ill admit im a novice with VB.net.
Can anyone help me please?
Thanks
D
I've build a label program in Visual Basic 6 about 2 years ago, everything works perfect with it but i lost my original VB files for editing the program and have decided to rebuild using VB.Net (MS VB Express 2008 Free).
The problems im having relate to a search box i had in one of my forms. Basically the form was connected to an Access DB which stored 3500+ details on serial numbers and location codes for items within a warehouse. When a user typed the serial number into the search box, clicked the search button all the details filled into label.captions on the form. The user would verify everything and maybe enter in a few more details on Textbox's before printing a nice little label. This was my VB Code for the search box:
Private Sub CmdSearch_Click()
txtpartno.Text = TxtSearch.Text
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
If opin Then
DataEnvironment1.rsCommand1.MoveFirst
DataEnvironment1.rsCommand1.Find ("[No] ='" & (TxtSearch.Text) & "'")
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
End If
If Opdes1 Then
DataEnvironment1.rsCommand1.MoveNext
DataEnvironment1.rsCommand1.Find ("[Description] ='" & (TxtSearch.Text) & "'")
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
End If
If Opdes2 Then
DataEnvironment1.rsCommand1.MoveNext
DataEnvironment1.rsCommand1.Find ("[Description 2] ='" & (TxtSearch.Text) & "'")
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
End If
If Opdes3 Then
DataEnvironment1.rsCommand1.MoveNext
DataEnvironment1.rsCommand1.Find ("[Description 3] ='" & (TxtSearch.Text) & "'")
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
End If
TxtLotR.Text = "PR-"
TxtLotR.SetFocus
End Sub
Problem i cant seem to get past is that .Find doesnt exist in VB.Net and the whole DataEnvironment has changed to a Datasource and ill admit im a novice with VB.net.
Can anyone help me please?
Thanks
D