What causes invalid use of property in visual basic

I'm getting an compile error invalid use of property when using editmode on a Adodb recordset. The command is
rs.edit in the following code:
Set rs = cn.Execute("select * from [family info] WHERE [family #] = '" & FamilyNum & "' ")
If Not rs.EOF Then
  ' do your field update here.
End If
What is the reason for the invalid use of property?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

what options are you using on the open
not sure if this is the solution cause I have no way of validating it. but shouln't rs.EditMode be followed by something like "True"
whiwexAuthor Commented:
I addaed true to the edit but I get the same error

Here's my open

cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\manna\database\manna families.mdb;Persist Security Info=False"
First, you get this error because EditMode is a property, and not a method. You use a property to either set or get its value.
For example:

  Form1.Caption="Hello"     'Here you set the value of the Caption property
  myString=Form1.Caption  ' Here you get the value of the Caption property

  Form1.Caption                 'Invalid use of property

Second, the EditMode is a read-only property. Therefore, you cannot set its value. You can only "read" its value.
Take a look at this:



  Nayer Naguib

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
whiwexAuthor Commented:
Thanks your right. I thought you needed it to edit a selected record. I don't need it in my code.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.