473,396 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to display record in textbox on SSTab from vb6

i have record saved in msaccess which i want to display on an SSTab containing text boxes and combo boxes. i have created a procedure to display the record on click of the ID which appears on a list box. this is he code:

Private Sub lstSearch_Click()
If cboCategory.Text = "SKIN" Then
DisplaySkinRecord
Else
DisplayStateRecord
End If
End Sub

this is the procedure:

Public Sub DisplaySkinRecord()
'On Error Resume Next
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
With cn
.ConnectionString = DBPATH
.Open
End With
With rs
.ActiveConnection = cn
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Source = "Select * From SkinRecord Where FileNumber ='" & Trim(txtFileNumber.Text) & "'"
.Open
If .RecordCount > 0 Then
cboSS.Text = .Fields("LandCategory")
txtFileNumber.Text = .Fields("FileNumber")
txtPlotNo1.Text = .Fields("PlotNo")
cboArea1.Text = .Fields("Area")
cboUser1.Text = .Fields("User")
cboBlock1.Text = .Fields("Block")
txtSite.Text = .Fields("Site")
cboTerm.Text = .Fields("Term")
dtpCommence.Value = .Fields("Commence")
dtpExpiry.Value = .Fields("Expiry")
txtRentPassing.Text = .Fields("RentPassing")
cboRevision.Text = .Fields("RentRevision")
txtLesseeName.Text = .Fields("LesseeName")
txtAddress.Text = .Fields("Address")
txtContact.Text = .Fields("Contact")
cboGrantor.Text = .Fields("Grantor")
dtpGrantDate.Value = .Fields("GrantDate")
dtpEntryDate.Value = .Fields("EntryDate")
End If
End With
End Sub
Jul 31 '16 #1
0 999

Sign in to post your reply or Sign up for a free account.

Similar topics

38
by: MLH | last post by:
I have 2 global constants declared in the same global module: Global Const MY_VERSION$ = "1.04" Global Const ProjectName$ = "MyProj" I have 2 global procedures designed to return the value of...
4
by: mahadevk | last post by:
hi, friends pl help me, how to display record count in a report for a grouped records
3
by: technocraze | last post by:
Hi community experts, May I knw whether is it possible to display the corresponding value of the second textbox based on the user input in the first textbox? This means that once the user enters...
0
by: rehanmomin | last post by:
Just to start off, I am writing a web application using C#. I have a Menu which is binded to an XML datasource. There are three menu items each with submenus and a textbox where I want to display...
1
by: beemomo | last post by:
hi everyone! i need to display all the data of a record in a form by selecting the value of combobox. for example when i select a Project_No display in combobox, the correspondence data of that...
2
by: Swapnil Mestry | last post by:
I want to display record in this format: PATIENT_CODE,gender,Malecount,femalecount Select PATIENT_CODE,gender,count(*) From BABY_MASTER Where Patient_Code='KBB-04-2010-96' group by...
1
by: calv | last post by:
Hi, I am using visual studio 2005 for a project and i am using ADODB connection to connect to the sqlite database. I would like to know how do i read and display record from the sqlite...
9
gcoaster
by: gcoaster | last post by:
Hello Group I need help, I need to use an to show results values from a table and display in a unbound textbox on a form. the results from each column in the table need to be on seperate...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.