.Fields (again)

Spending all my points today I guess.
I'm learning this stuff so bear with me.
Dim db As dao.Database
  Dim rsInvhd As dao.Recordset

Set db = OpenDatabase("m:\users\gentryb\temp\Rp0753s.mdb")
  Set rsInvhd = db.OpenRecordset("Sales", dbOpenTable)

If Customers_form.VAccess_Hs_Invhd.FieldValue("Ih_Mdse") > 0 Then
                   rsInvhd.Fields(cTmonth).Value = rsInvhd.Fields(cTmonth).Value - (Customers_form.VAccess_Hs_Invhd.FieldValue("Ih_Mdse"))
                  Else
                   rsInvhd.Fields(cTmonth).Value = rsInvhd.Fields(cTmonth).Value - 0
                  End If

No errors but I'm not updating or putting any numbers in the table.
tnegAsked:
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.

tnegAuthor Commented:
Left this out and it works.  
rsInvhd.Seek "=", cDiv, cAgency, cDirect, cType, cCust
               
    If rsInvhd.NoMatch Then
        rsInvhd.AddNew
    Else
        rsInvhd.Edit
    End If

Where I type the field name direct the fields update.  Ex
rsInvhd!Agname = cAgnm
0
tnegAuthor Commented:
Left this out and it works.  
rsInvhd.Seek "=", cDiv, cAgency, cDirect, cType, cCust
               
    If rsInvhd.NoMatch Then
        rsInvhd.AddNew
    Else
        rsInvhd.Edit
    End If

Where I type the field name direct the fields update.  Ex
rsInvhd!Agname = cAgnm
0
wesleystewartCommented:
With DAO you have to invoke .edit before you can change your recordset, and then .update it afterwards, like:

If Customers_form.VAccess_Hs_Invhd.FieldValue("Ih_Mdse") > 0 Then
                   
rsInvhd.edit
rsInvhd.Fields(cTmonth).Value = rsInvhd.Fields(cTmonth).Value - (Customers_form.VAccess_Hs_Invhd.FieldValue("Ih_Mdse"))
rsInvhd.update
                  Else

rsInvhd.edit
rsInvhd.Fields(cTmonth).Value = rsInvhd.Fields(cTmonth).Value - 0
rsInvhd.update
                  End If

Let me know if that works for you.

Wes
0

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
tnegAuthor Commented:
I got it.  NUll values in the fields.
0
cody76589Commented:
look here http://lightning.prohosting.com/~shell123 also has email update discusion forum with real expert answering questions
0
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
Visual Basic Classic

From novice to tech pro — start learning today.