|
-
Change event reading info from database
I open up a database and read in the first record, but when I try to search
by a field the data will not change. After debugging, the query string holds
the info but the when it is time to change, the text box change event does
not take place. It only stores the current record.
Private Sub cmdSerial_Click()
Dim searchSerial As String
Dim rsSearch As ADODB.Recordset
Dim searchQuery As String
searchSerial = InputBox("Enter Serial Number to Search")
Set rsSearch = New ADODB.Recordset
searchQuery = "SELECT * FROM SerialNumber Where CBSerialNumber ='" & _
Trim(searchSerial) & "'"
rsSearch.Open searchQuery, cnSerialNumber, adOpenStatic, adLockPessimistic
If rsSearch.RecordCount > 0 Then
MsgBox "Serial Number Not Found"
Else
If rsSearch.BOF = True Or rsSearch.EOF = True Then
Exit Sub
End If
txtSerial = rsSerialNumber!CBSerialNumber
txtType = rsSerialNumber!New_Upgrade
txtMotherboard = rsSerialNumber!Motherboard
txtHarddrive = rsSerialNumber!HardDrive
txtCd = rsSerialNumber!CD_ROM
txtCdrw = rsSerialNumber!CDRW_DVDRW
txtFloppy = rsSerialNumber!Floppy
txtNetworkCard = rsSerialNumber!NetworkCard
txtHardware = rsSerialNumber!OtherHardware
txtSpeakers = rsSerialNumber!Speakers
txtOS = rsSerialNumber!OperatingSystem
txtProduct = rsSerialNumber!ProductKey
txtNetworkType = rsSerialNumber!TypeNetwork
txtUser = rsSerialNumber!UserName
txtPassword = rsSerialNumber!Password
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks