+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20

Thread: Query Help

  1. #16
    Registered User
    Join Date
    11-28-2011
    Location
    St. Louis, Missouri
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: Query Help

    These are the ones that are checked:

    Visual Basic for Applications
    Microsoft Access 12.0 Object Library
    OLE Automation
    Microsoft ActiveX Data Objects 2.1 Library
    Microsoft DAO 3.6 Object Library

  2. #17
    Valued Forum Contributor alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Lake County, Illinois
    MS-Off Ver
    MS Office 2010, 2007 and 2002
    Posts
    1,161

    Re: Query Help

    None indicated as missing?

  3. #18
    Registered User
    Join Date
    11-28-2011
    Location
    St. Louis, Missouri
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: Query Help

    nope nothin coming up saying anything is missing

  4. #19
    Valued Forum Contributor alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Lake County, Illinois
    MS-Off Ver
    MS Office 2010, 2007 and 2002
    Posts
    1,161

    Re: Query Help

    A little bit of tweaking and I got it to work.

    
    Private Sub Command4_Click()
    Dim mydb As DAO.Database
    Dim myset As DAO.Recordset
    Dim mycategory As String
    
    Set mydb = CurrentDb
    Set myset = mydb.OpenRecordset("Table1")
    Do Until myset.EOF
    
    myset.Edit
    If myset!Coverage = "CCPLAT" Then
    Select Case myset!Mileage
    Case 0 To 24000
    [mycategory] = "24,000"
    Case 24001 To 36000
    [mycategory] = "36,000"
    Case 36001 To 50000
    [mycategory] = "50,000"
    Case 50001 To 60000
    [mycategory] = "60,000"
    Case Else
    [mycategory] = "N/A"
    End Select
    
    ElseIf myset!Coverage = "CCDIAM" Then
    Select Case myset!Mileage
    Case 0 To 50000
    [mycategory] = "50,000"
    Case 50001 To 75000
    [mycategory] = "75,000"
    Case 75001 To 100000
    [mycategory] = "100,000"
    Case 100001 To 125000
    [mycategory] = "125,000"
    Case 125001 To 150000
    [mycategory] = "150,000"
    Case Else
    [mycategory] = "N/A"
    End Select
    End If
    myset("Category").Value = mycategory
    myset.Update
    
    myset.MoveNext
    Loop
    MsgBox ("Your Table is Updated!")
    End Sub

  5. #20
    Registered User
    Join Date
    11-28-2011
    Location
    St. Louis, Missouri
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: Query Help

    Awesome that's great! Thanks for the help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0