Welcome to Dream.In.Code
Become a VB Expert!

Join 137,179 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,381 people online right now. Registration is fast and FREE... Join Now!




Method or ata member not found

 
Reply to this topicStart new topic

Method or ata member not found, Compile error

laliths
25 Jun, 2008 - 02:56 AM
Post #1

New D.I.C Head
*

Joined: 25 Jun, 2008
Posts: 1

CODE

    

    datEmployee.DatabaseName = strDBLocation
    datEmployee.RecordSource = "tblEmployee"
    datEmployee.Refresh
    
    dtSourceEmployee = datEmployee

    Do While Not datEmployee.Recordset.EOF
    cmbStNo.AddItem datEmployee.Recordset.Fields("EmpStaffNo").Value
    datEmployee.Recordset.MoveNext
    Loop

    txtStNo.DataSource = dtSourceEmployee
    txtStNo.DataField = "EmpStaffNo"



When I run the programme by pressing F5, the error message says;

' Compile error'

Method or data member not found

lalith.Attached File  ERROR_MESSAGE_01.doc ( 127.5k ) Number of downloads: 8

User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Method Or Ata Member Not Found
25 Jun, 2008 - 04:55 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,004



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
What line does it say contains the error please? smile.gif
User is online!Profile CardPM
+Quote Post

tope10
RE: Method Or Ata Member Not Found
26 Jul, 2008 - 01:19 AM
Post #3

New D.I.C Head
*

Joined: 25 Jun, 2008
Posts: 22



Thanked: 2 times
My Contributions
QUOTE


Try to check the spelling of the table name in your database if it match the recordsource you type in the code.

Did you use DataGrid Control?

I think you want to retrieve the record in the database and put it on the combo box.

Let me give you a sample:



CODE


'on the references select the microsoft activex dataobject 2.1 library.
' Create a database using microsoft access and the Filename is category and create table and name it as tblCategory"
' add combobox control and name it as cboCategory

dim cn as new adodb.connection
dim rs as adodb.recordset

Private sub Form_Load()

cn.provider = "Microsoft.Jet.Oledb.4.0"
cn.open app.path & "\Category.mdb"
if cn.state = adstateopen then
        set rs = new adodb.recordset
       rs.open "Select * from tblCategory",cn,adopendynamic,adlockoptimistc

end if

End sub

Private sub cbocategory_Dropdown()
  cbocategory.clear
  rs.requery
  
  do while not rs.eof
      cbocategory.addtem rs![name of the fields]
      rs.movenext
  loop

end sub



This post has been edited by tope10: 26 Jul, 2008 - 01:26 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 11:08AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month