473,397 Members | 2,116 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,397 software developers and data experts.

how to solve liListItem As ListItem this userdefinend is not type error in vb0.6

Expand|Select|Wrap|Line Numbers
  1. Dim liListItem As ListItem
  2. Private Sub ListView1_BeforeLabelEdit(Cancel As Integer)
  3.  
  4. End Sub
  5.  
  6. Private Sub cboAccNo_Change()
  7. Set rsTemp = New ADODB.Recordset
  8. rsTemp.Open "Select * from tblCustomers Where AccountNo='" & cboAccNo.Text & "'", cnBank, adOpenKeyset, adLockOptimistic
  9. With rsTemp
  10. If .RecordCount > 0 Then
  11. cboAccNo = !AccountNo
  12. cboCustomerID = !CustomerID
  13. cboFirst = !FirstName
  14. Else
  15. MsgBox "Invalid customer ID/Name/Account NO. Please Try Again", vbInformation
  16. Exit Sub
  17. End If
  18. .Close
  19. End With
  20.  
  21.  
  22. Set rsTemp = New ADODB.Recordset
  23. rsTemp.Open "Select * from tblTransactions Where AccountNo='" & cboAccNo.Text & "'", cnBank, adOpenKeyset, adLockOptimistic
  24. With rsTemp
  25. If .RecordCount > 0 Then
  26. lvwDeposit.ListItems.Clear
  27. Call LoadListView(rsTemp)
  28. 'cboAccNo = !AccountNo
  29. 'cboCustomerID = !CustomerID
  30. 'cboFirst = !FirstName
  31. Else
  32. MsgBox "Invalid customer ID/Name/Account NO. Please Try Again", vbInformation
  33. Exit Sub
  34. End If
  35. .Close
  36. End With
  37.  
  38. End Sub
  39.  
  40. Private Sub cboCustomerID_Change()
  41.  
  42. Set rsTemp = New ADODB.Recordset
  43. rsTemp.Open "Select * from tblCustomers Where customerID='" & cboCustomerID.Text & "'", cnBank, adOpenKeyset, adLockOptimistic
  44. With rsTemp
  45. If .RecordCount > 0 Then
  46. cboAccNo = !AccountNo
  47. cboCustomerID = !CustomerID
  48. cboFirst = !FirstName
  49. Else
  50. MsgBox "Invalid customer ID/Name/Account NO. Please Try Again", vbInformation
  51. Exit Sub
  52. End If
  53. .Close
  54. End With
  55.  
  56. Set rsTemp = New ADODB.Recordset
  57. rsTemp.Open "Select * from tblTransactions Where customerID='" & cboCustomerID.Text & "'", cnBank, adOpenKeyset, adLockOptimistic
  58. With rsTemp
  59. If .RecordCount > 0 Then
  60. lvwDeposit.ListItems.Clear
  61. Call LoadListView(rsTemp)
  62. Else
  63. MsgBox "No Transactions bearing this customer ID. Please Try Again", vbInformation
  64. Exit Sub
  65. End If
  66. .Close
  67. End With
  68. End Sub
  69.  
  70. Private Sub cboFirst_Change()
  71. Set rsTemp = New ADODB.Recordset
  72. rsTemp.Open "Select * from tblCustomers Where FirstName='" & cboFirst.Text & "'", cnBank, adOpenKeyset, adLockOptimistic
  73. With rsTemp
  74. If .RecordCount > 0 Then
  75. cboAccNo = !AccountNo
  76. cboCustomerID = !CustomerID
  77. cboFirst = !FirstName
  78. Else
  79. MsgBox "Invalid customer ID/Name/Account NO. Please Try Again", vbInformation
  80. Exit Sub
  81. End If
  82. .Close
  83. End With
  84.  
  85.  
  86. Set rsTemp = New ADODB.Recordset
  87. rsTemp.Open "Select * from tblTransactions Where CustomerID='" & cboCustomerID.Text & "'", cnBank, adOpenKeyset, adLockOptimistic
  88. With rsTemp
  89. If .RecordCount > 0 Then
  90. lvwDeposit.ListItems .Clear
  91. Call LoadListView(rsTemp)
  92. Else
  93. MsgBox "No Transactions bearing this customers' first name. Please Try Again", vbInformation
  94. Exit Sub
  95. End If
  96. .Close
  97. End With
  98.  
  99. End Sub
  100.  
  101. Private Sub Cmdedit_Click()
  102. frmDeposits.Show
  103. frmCustomers.Hide
  104. frmWithdrawal.Hide
  105. frmTransactions.Hide
  106. frmTransactions.Hide
  107. frmAccTypes.Hide
  108. frmSearch.Hide
  109. frmDepositlst.Hide
  110. End Sub
  111.  
  112. Private Sub cmdPrint_Click()
  113. MsgBox "Report Is Under Construction Please Try After Some Time", vbInformation
  114. Unload Me
  115. End Sub
  116.  
  117. Private Sub CmdPrnall_Click()
  118. 'Set rptDeposits.DataSource = Nothing
  119. 'Set rptDeposits.DataSource = rsDeposit
  120. 'rptDeposits.Show
  121. FrmDepoRepoFull.Show
  122. Unload Me
  123. End Sub
  124.  
  125. Private Sub CmdProceed_Click()
  126. Set rsTemp = New ADODB.Recordset
  127. rsTemp.Open "Select * from tblDeposits Where Dated BETWEEN #" & DtFrom.Value & "# AND #" & DtTo.Value & "#", cnBank, adOpenKeyset, adLockOptimistic
  128. With rsTemp
  129. If .RecordCount > 0 Then
  130. lvwDeposit.ListItems.Clear
  131. Call LoadListView(rsTemp)
  132. Else
  133. MsgBox "No Transactions Were carried out between these Dates. Please Try Again", vbInformation
  134. Exit Sub
  135. End If
  136. .Close
  137. End With
  138. End Sub
  139.  
  140.  
  141. Private Sub Cmdqt_Click()
  142. Unload Me
  143. End Sub
  144.  
  145. Private Sub cmdquit_Click()
  146. Unload Me
  147. End Sub
  148.  
  149. Private Sub Form_Load()
  150. Call connectDatabase
  151. Call LoadListView(rsDeposit)
  152. With rsDeposit
  153. .MoveFirst
  154. 'For X = 1 To .RecordCount
  155.  '   CboCustome.AddItem !CustomerID
  156.   '  cboFirst.AddItem !FirstName
  157.    ' cboAccNo.AddItem !AccountNo
  158.     '.MoveNext
  159. 'Next X
  160. End With
  161. 'FrmDate.Enabled = True
  162. End Sub
  163.  
  164. Private Sub lvwDeposit_ColumnClick(ByVal ColumnHeader As MSComCtlLib.ColumnHeader)
  165. ' Sort according to data in this column.
  166.     If lvwDeposit.Sorted And _
  167.         ColumnHeader.Index - 1 = lvwDeposit.SortKey Then
  168.         ' Already sorted on this column, just invert the sort order.
  169.         lvwDeposit.SortOrder = 1 - lvwDeposit.SortOrder
  170.     Else
  171.         lvwDeposit.SortOrder = lvwAscending
  172.         lvwDeposit.SortKey = ColumnHeader.Index - 1
  173.     End If
  174.     lvwDeposit.Sorted = True
  175. End Sub
  176.  
  177. Public Sub LoadListView(myRs As Recordset)
  178. With myRs
  179. While Not .EOF
  180. 'lvwDeposit.ListItems.Add , , !CustomerID & " " & !AccountNo ' & " " & !Narration & " " & !Dated & " " & !Debit & " " & !Credit
  181. 'Set lstItem = lvwDeposit.ListItems.Add(, , !TransactionID)
  182. Set lstItem = lvwDeposit.ListItems.Add(, , !CustomerID)
  183. 'lstItem.SubItems(1) = !TransactionID
  184. lstItem.SubItems(1) = !CustomerID
  185. lstItem.SubItems(2) = !AccountNo
  186. lstItem.SubItems(3) = !Narration
  187. lstItem.SubItems(4) = !AmountDeposited
  188. lstItem.SubItems(5) = !Mode
  189. lstItem.SubItems(6) = !CheckNO
  190. lstItem.SubItems(7) = !Dated
  191. .MoveNext
  192. Wend
  193. End With
  194. End Sub
  195.  
  196. Private Sub lvwDeposit_Click()
  197.  
  198. End Sub
  199.  
  200. Private Sub OptAcc_Click()
  201. FrmDate.Enabled = False
  202. 'FrmDate.Enabled = True
  203. Set rsTemp = New ADODB.Recordset
  204. rsTemp.Open "Select * from tblDeposits", cnBank, adOpenKeyset, adLockOptimistic
  205. With rsTemp
  206. If .RecordCount > 0 Then
  207. lvwDeposit.ListItems.Clear
  208. Call LoadListView(rsTemp)
  209. Else
  210. MsgBox "Database Empty..", vbInformation
  211. Exit Sub
  212. End If
  213. .Close
  214. End With
  215. End Sub
  216.  
  217. Private Sub OptDate_Click()
  218. FrmDate.Enabled = True
  219. Set rsTemp = New ADODB.Recordset
  220. rsTemp.Open "Select * from tblDeposits", cnBank, adOpenKeyset, adLockOptimistic
  221. With rsTemp
  222. If .RecordCount > 0 Then
  223. lvwDeposit.ListItems.Clear
  224. Call LoadListView(rsTemp)
  225. Else
  226. MsgBox "Database Empty..", vbInformation
  227. Exit Sub
  228. End If
  229. .Close
  230. End With
  231.  
  232. End Sub
  233.  
how to solve liListItem As ListItem this userdefinend is not type error in vb0.6
Nov 29 '12 #1
2 2785
Stewart Ross
2,545 Expert Mod 2GB
You have not said where your error is occurring, and I won't read 200 lines of code to try to debug what you should have done for yourself.

The most likely problem is that you have no definition of the type ListItem which you use throughout your code. You certainly don't show any definition of what ListItem is. If the type ListItem is defined in a class module then it does not appear to be present or in scope at the time you are referring to it.

-Stewart
Nov 29 '12 #2
Killer42
8,435 Expert 8TB
When asking a question, please try to be as clear as possible. You need to include specific details of what's wrong (important: be precise - for instance, I'm pretty sure VB6 has never said "this userdefinend is not type error") and indicate where and under what circumstances the problem occurs. When compiling? When executing? What line?
Nov 30 '12 #3

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

Similar topics

102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
7
by: darrel | last post by:
What does that MEAN? I'm working on a VS project with another person. We keep our DLLs and files in sync with each other. Last week I hit a snag where i kept getting the 'could not load type'...
0
by: Curtiss | last post by:
I receive "could not load type" error message when trying to load aspx page. The DLL is built and is located in the correct bin directory. The type name in the "inherits" attribute matches the...
4
by: Sparky Arbuckle | last post by:
I am looping through a listbox collection to build a SQL string that will be used to delete items from a database. I have tried many variances of the code below but have had no luck. The code below...
3
by: pmiller | last post by:
I ported my code from the development to application platform, I found a "type error" on a fileout statement: outfile.write(object.id +",") Object.id is provided by a library routine that is...
3
by: Alden Pierre | last post by:
Hello, I'm having a hard time trying to figure why my code will not compile. When I try to compile the code, I get the non-aggregate type error. Any ideas on what I'm doing wrong? ...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
2
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my...
2
by: unclefester | last post by:
I have two classes: Test1 and Test2. Test1 has a field of data type Test2, & vice versa. I need some help in avoiding the incomplete type error ("Error: field has incomplete type"). Test1.h ...
6
by: kmtech | last post by:
I have a spreadsheet named Log with data in range A11:X1200 that I would like to change each raw's background color based on the value in column Y for that raw. Column Y values are set between 1...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

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.