Results 1 to 3 of 3
  1. #1
    Charles618 is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2014
    Posts
    1

    Question Can I ask Access to automatically enter data in a field if a certain word is found...

    Good morning!


    Here's my problem: I have a table with 715K records. Each record is an inventory product, and the sixth field of each record is a short description. The tenth field is a single-letter category designation, and is currently blank. What I want to do is search through the description field of every line, and where the word "Paint" is contained, enter a letter "P" in the category field.



    Is this even possible? Thanks in advance for help. I'm completely stumped here.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Yes it should be possible using an update query. Search the forum and Google for details. There's lots of info out there. Here's one link that may help: http://office.microsoft.com/en-gb/ac...010076527.aspx Post back if you're still stuck.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    With that many records it may be worthwhile to store the results of your search. However, if storing calculated data like this is in the interest of speed, you will need to incorporate a procedure to update the table each time a new record is added, a procedure to see if you need to write "P" to another column.

    An alternative to storing the results would be to create an alias in a query. This new column would be a virtual column and the criteria would search the entire table each time the query is used.

    An alias would look something like this.
    MyAlais: IIf(InStr(tblName.FieldName, "Paint"), "P", "")

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Automatically running Word Mailmerge from Access VBA
    By pledbetter in forum Programming
    Replies: 13
    Last Post: 04-14-2018, 05:06 PM
  2. Replies: 15
    Last Post: 04-17-2014, 02:21 PM
  3. Replies: 2
    Last Post: 10-02-2012, 09:54 PM
  4. Split string when specific word is found
    By DB4284 in forum Programming
    Replies: 1
    Last Post: 11-18-2010, 03:30 PM
  5. How do I enter data automatically?
    By ffurqana in forum Access
    Replies: 0
    Last Post: 07-08-2010, 07:47 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums