+ Reply to Thread
Results 1 to 2 of 2

Using ADO in Excel VBA - Search for Field in Access Database

  1. #1
    Registered User
    Join Date
    08-23-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Using ADO in Excel VBA - Search for Field in Access Database

    Using ADO in Excel VBA-Search for Field in Access Database

    --------------------------------------------------------------------------------
    I'm fairly new to ADO and I'm trying to figure out how to search for a field inside an Access Database by using Excel VBA. I am able to retrieve a record by finding a value in a particular field, but when the field is not found is when I'm having the issue.

    I would like to have an if statement or other workaround where if the field value I am looking for is not found, then a userform will popup to prompt the user to register their information. if I can just get the syntax down on how to do something else when the field is not found, I will be okay.


    Below is the vba code I am using in Excel...

    I am retrieving the user's Windows Logon ID, and then going to Access to Retrieve their email address from a table named Employees.



    Code:
    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: Using ADO in Excel VBA - Search for Field in Access Database

    By the field is not found you mean there is no employee in the database? or there is no email associated with the employee?

    The reason I ask is they create 2 different issues.

    Please Login or Register  to view this content.

    Those are examples of how I would mitigate both situations.

    Hope this helps,

    Dan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1