Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Basic to VB.Net 2008, search text box

Status
Not open for further replies.

dedo8816

Programmer
Oct 25, 2006
94
GB
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
 
Thanks i'll take a peak later and see what i can figure out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top