Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Record exists?

Posted on 1998-09-18
2
Medium Priority
?
151 Views
Last Modified: 2010-04-30
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
Comment
Question by:IsleOfView
2 Comments
 

Author Comment

by:IsleOfView
ID: 1435584
Edited text of question
0
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 160 total points
ID: 1435585
Assuming the table has Name field

rs.FindFirst("Name=MyName")
if rs.NoMatch() then rs.AddNew else rs.Edit
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month20 days, 20 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question