• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

Record exists?

I'm working with a Visual Basic app that needs to update data in an Access database.  Everything works fine, but how do you do a routine like the following:

If a record exists then
    update a field in the existing record
Else
    insert record with appropriate data
End If

By the way, I'm not using the Data control - I just want to use statements through the Jet engine.

Thanks
0
IsleOfView
Asked:
IsleOfView
1 Solution
 
IsleOfViewAuthor Commented:
Edited text of question
0
 
MikeP090797Commented:
Assuming the table has Name field

rs.FindFirst("Name=MyName")
if rs.NoMatch() then rs.AddNew else rs.Edit
0
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.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now