Searching through table description in MS Access

I am trying to search through a table and if the description contains a keyword , to have the "MIMSfield" row update.

See screenshot:

http://postimg.org/image/jivnfus5r/full/

Some direction would be awesome, not overly familiar with Access. Assuming this can be done with a VB module.

For example: If the description contains "Airlines" make the MIMSfield = A113

Upvotes: 0

Views: 86

Answers (2)

Radek
Radek

Reputation: 241

You dont need to use VBA. In Access go to Tab Create, button Query Design, close the window with tables that appears, swich to SQL View and write SQL command like below (use your variables) and press Run(!)

UPDATE TableName SET MIMSfield = 'WhatEver' WHERE description LIKE '*KeyWord*';

You can make the query with outer parameters like this:

UPDATE TableName SET MIMSfield = [WhatEver] WHERE description LIKE '*' + [KeyWord] + '*';

You will be prompted to provide the parameters while running the query.

Upvotes: 1

Pushpak
Pushpak

Reputation: 1

First of all you have to make a table of codes for MIMSField with keywords i.e. A113 for Airlines, A104 for car etc. than use VBA module.

Upvotes: 0

Related Questions