Results 1 to 2 of 2
  1. #1
    orimpila is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    4

    access vba: change every value of a field with multiple criteria

    Hello! I made this code in excel, and I'd love to get it working in access.
    Code:
    Sub dips ()
    Dim area As Range
    Dim cell As Range
    Set area = Range("A1:A300")
    For Each cell In area
    If cell.Value = "11" Then
    cell.value = "aa"
    Else If cell.value ="22" Then
    cell.value = "bb"
    End If
    Next cell
    End Sub
    How do i set the wanted field? And how about the loop? I tried UPDATE in SQL but couldn't get values to change with multiple criteria. My boss just assumed if i know excel i know acces :/

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How many fields does each record have? How many records in the table?

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

Similar Threads

  1. Replies: 7
    Last Post: 04-23-2013, 11:57 AM
  2. Replies: 7
    Last Post: 01-02-2013, 11:23 PM
  3. Change field criteria in a report, or query
    By mdnikki in forum Reports
    Replies: 3
    Last Post: 10-05-2012, 12:43 PM
  4. consultation with field for multiple criteria
    By fabiobarreto10 in forum Queries
    Replies: 21
    Last Post: 03-05-2012, 01:59 PM
  5. Replies: 30
    Last Post: 03-01-2011, 10:05 AM

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