6 Replies - 359 Views - Last Post: 20 September 2017 - 03:59 AM Rate Topic: -----

#1 shiv13  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 19-September 17

i m receiving error of method and data member not found

Posted 19 September 2017 - 10:29 AM

Private Sub cmdorder_Click()
Dim query As String
query = "insert into customer(Customer Id,Customer Name,Bill Id,Cosmetic Name,Price,Quantity,Total Amount)values('" & txtcid & "'," & txtcname & "," & txtid & "," & cmbitem.Selected & "," & txtprice & "," & txtqt & "," & txttotalamt & ")"
con.Execute query
cust.Requery
cust.MoveLast
Call display


End Sub
:code:

this is my code i have connect database using module
it highlights txtid

This post has been edited by modi123_1: 19 September 2017 - 11:06 AM
Reason for edit:: In the future please use the [code] tags in the editor.


Is This A Good Question/Topic? 0
  • +

Replies To: i m receiving error of method and data member not found

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13485
  • View blog
  • Posts: 53,847
  • Joined: 12-June 08

Re: i m receiving error of method and data member not found

Posted 19 September 2017 - 11:06 AM

It is customary to copy/paste your error messages here.
Was This Post Helpful? 0
  • +
  • -

#3 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 328
  • View blog
  • Posts: 1,990
  • Joined: 26-March 09

Re: i m receiving error of method and data member not found

Posted 19 September 2017 - 11:58 PM

Couple of comments/questions.

1. What are txtcname, txtid, etc. Are they text boxes or strings? If text boxes, then you should use the text property, txtcname.text
2. Print out your query to the debug window and try executing it directly in your sql tool (management studio if MS SQL).
3. Look at your single quote usage, you have it on one value which with it's name suggests an id field.
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is offline

  • the case is sol-ved
  • member icon

Reputation: 6376
  • View blog
  • Posts: 25,763
  • Joined: 12-December 12

Re: i m receiving error of method and data member not found

Posted 20 September 2017 - 12:43 AM

You also need to handle the spaces between your field names, or change them so that they don't have spaces.
Was This Post Helpful? 0
  • +
  • -

#5 shiv13  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 19-September 17

Re: i m receiving error of method and data member not found

Posted 20 September 2017 - 01:50 AM

View Postmaj3091, on 19 September 2017 - 11:58 PM, said:

Couple of comments/questions.

1. What are txtcname, txtid, etc. Are they text boxes or strings? If text boxes, then you should use the text property, txtcname.text
2. Print out your query to the debug window and try executing it directly in your sql tool (management studio if MS SQL).
3. Look at your single quote usage, you have it on one value which with it's name suggests an id field.

since txtcname txtid are textboxes i have made changes in that as u suggested but now another error show for combobox i.e cmitem.selected so i remove combobox as well then another error occurs which is for call display i.e sub or function not defined
Was This Post Helpful? 0
  • +
  • -

#6 andrewsw  Icon User is offline

  • the case is sol-ved
  • member icon

Reputation: 6376
  • View blog
  • Posts: 25,763
  • Joined: 12-December 12

Re: i m receiving error of method and data member not found

Posted 20 September 2017 - 03:28 AM

So where is Display defined? And is it in scope/accessible from your click event?
Was This Post Helpful? 0
  • +
  • -

#7 shiv13  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 19-September 17

Re: i m receiving error of method and data member not found

Posted 20 September 2017 - 03:59 AM

View Postshiv13, on 20 September 2017 - 01:50 AM, said:

View Postmaj3091, on 19 September 2017 - 11:58 PM, said:

Couple of comments/questions.

1. What are txtcname, txtid, etc. Are they text boxes or strings? If text boxes, then you should use the text property, txtcname.text
2. Print out your query to the debug window and try executing it directly in your sql tool (management studio if MS SQL).
3. Look at your single quote usage, you have it on one value which with it's name suggests an id field.

since txtcname txtid are textboxes i have made changes in that as u suggested but now another error show for combobox i.e cmitem.selected so i remove combobox as well then another error occurs which is for call display i.e sub or function not defined

can you please help me with that with another code which will work basically i want to add records in ms access through unbound connectivity hoping for the best
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1