I Have been Strugling to Write the Code for Multicolumn to Display two feilds in m combo below is my code for the it
keeps on giving the Error
DATASOURCE NAME NOT FOUND AND NO DEFAULT DRIVER SPECIFIED
where as i already supplied this plz have look
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strSQL As String
On Error GoTo General_Error
cn.Open SysConnect (This is Connection String where everey thing is supplied)
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
strSQL = ""
strSQL = "Select * from cus0001s"
rs.Open Trim(strSQL), cn, , , adCmdUnspecified
NSDataCombo1.Columnclear
If Not rs.EOF And Not rs.BOF Then
While Not rs.EOF
If Not IsNull(rs!cid) Then
NSDataCombo1.AddColumn Trim(rs!cid)
NSDataCombo1.AddColumn Trim(rs!cin)
End If
rs.MoveNext
Wend
End If
rs.Close
cn.Close
On Error GoTo 0
Exit Sub
General_Error:
MsgBox "Error: [" & Err.Number & "] " & Err.Description, vbCritical + vbOKOnly, "Stock Control Management SCM (V1.01)"
If rs.State = ADODB.adRecObjectOpen Then
rs.Close
End If
If cn.State = 1 Then
cn.Close
End If
On Error GoTo 0
Try this code instead:
i have copied you code and entered the desired table name and connection string but it says the same
can you please check for me or give any other solutions plz......
Private Sub NSDataCombo1_Change()
With NSDataCombo1
NSDataCombo1.ClearColumn
NSDataCombo1.AddColumn "suc", 1794.89
NSDataCombo1.AddColumn "sun", 2264.88
NSDataCombo1.Connection = cn.SysConnect
'NSDataCombo1.Connection = SysConnect---this my connection string
NSDataCombo1.sqlFields = "suc, sun"
NSDataCombo1.sqlTables = "su007g9"
NSDataCombo1.sqlSortOrder = "suc ASC"
NSDataCombo1.BoundField = "sun"
NSDataCombo1.PageBy = 25
NSDataCombo1.DisplayCol = 2
NSDataCombo1.setDropWindowSize 7000, 4000
NSDataCombo1.TextReadOnly = True
NSDataCombo1.SetDropDownTitle = "su007g9 Record"
End With
End Sub
Why you declare the connection properties twice?
One is Commented out i have only declared just one the other one is commented out.
i am very eagerly waiting for you help sir,
Again, why you put that in the change event? That is not the proper way. You should put that under load even or in any procedure and call it everywhere before you use that control.
I think that's where you stuck up.
You Have Sougted out my biggest problem sir you are simply great cheif all the best and god bless
Thanks
Sir,
You Solution worked and i really thank full to you
but when i try to a condition it dosnt work
i will paste my code here plz have look can i get solution for this
With NSDataCombo2
.ClearColumn
.AddColumn "Item Code", 6400.89
.Connection = SysConnect
.sqlFields = "Select Pc From Sre00rv001 where dn='" & (NSDataCombo1.Text) & "'"
.sqlFields = "pc"
.PageBy = 25
.DisplayCol = 1
.setDropWindowSize 6500, 3000
.TextReadOnly = False
.SetDropDownTitle = "Receiving Voucher Information"
End With
here it shows blank where as there is data in that condition
can u please help me out in this......
Sir,
You Solution worked and i really thank full to you
but when i try to a condition it dosnt work
i will paste my code here plz have look can i get solution for this
With NSDataCombo2
.ClearColumn
.AddColumn "Item Code", 6400.89
.Connection = SysConnect
.sqlFields = "Select Pc From Sre00rv001 where dn='" & (NSDataCombo1.Text) & "'"
.sqlFields = "pc"
.PageBy = 25
.DisplayCol = 1
.setDropWindowSize 6500, 3000
.TextReadOnly = False
.SetDropDownTitle = "Receiving Voucher Information"
End With
here it shows blank where as there is data in that condition
can u please help me out in this
You cannot put the where clause within sqlFields properties. There is a separate properties for the where clause.
See the code below:
Sir,
can you helpme please?!!!
can you give me a sample code for the enrollment System?
what is the process to do for this?
sir help me for the code for Enrollment System!!!
thank you more power and GOD Bless!!!
I hope that u response about this..
Hi
Is there are way to open the drop down on gotfocus event and set the focus in search field. And then when ever any user presses any key the list should get filtered automatically without the need to press "Enter"
Sorry but you cannot do this without the original source code. Philip Naparan is selling the source code. If you like I can negotiate from him so you will have the source code.
Pages
Add new comment