Solved

Record exists?

Posted on 1998-09-18
2
147 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

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

Accepted Solution

by:
MikeP090797 earned 40 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

737 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