Results 1 to 7 of 7

Need to select particular value from table and display message

Threaded View

irfanparbatani Need to select particular... 09-05-2013, 01:08 AM
millz Re: Need to select particular... 09-05-2013, 01:21 AM
irfanparbatani Re: Need to select particular... 09-05-2013, 01:25 AM
millz Re: Need to select particular... 09-05-2013, 01:59 AM
irfanparbatani Re: Need to select particular... 09-05-2013, 02:07 AM
irfanparbatani Re: Need to select particular... 09-05-2013, 10:30 PM
irfanparbatani Re: Need to select particular... 09-08-2013, 09:02 PM
  1. #1
    Forum Contributor
    Join Date
    07-30-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    118

    Need to select particular value from table and display message

    Hi friends,

    I have this piece of code, it is showing me the message but it is not showing me the message according to the strategy_id and the corresponding message to strategy_id
    Set d = CurrentDb()
          Set r = d.OpenRecordset("Select * from Strategy_table")
          Set Strtgy_ID = r.Fields("Strategy_ID")
          Set Msg = r.Fields("Message")
          If InStr(1, Audit, "B3000:,", vbTextCompare) Or InStr(1, Audit, "B3001:", vbTextCompare) Or InStr(1, Audit, "B3002:", vbTextCompare) Or InStr(1, Audit, "B3004:", vbTextCompare) Or InStr(1, Audit, "B3006:", vbTextCompare) Or InStr(1, Audit, "B3008:", vbTextCompare) Or InStr(1, Audit, "B3010:", vbTextCompare) Or InStr(1, Audit, "B3012:", vbTextCompare) Or InStr(1, Audit, "B3014:", vbTextCompare) Or InStr(1, Audit, "B3016:", vbTextCompare) Or InStr(1, Audit, "B3018:", vbTextCompare) Or InStr(1, Audit, "B3010:", vbTextCompare) Or InStr(1, Audit, "B3030:,", vbTextCompare) _
          And InStr(2, " & Strategy & ", "Strtgy_ID", vbDatabaseCompare) Then
          If r.RecordCount > 0 Then
          r.MoveNext
          r.Edit
          
          ScriptingText(3) = Mid(Msg, 1, 77) ' Break string into 77 characters
          ScriptingText(4) = " " & Mid(Msg, 78, 154) ' print rest of the characters from message to next line
    r. close
    set r = nothing
    Please guide me, I am not able to print corresponding message comparing strategy id from the table.

    eg of strategy_table:
    Strategy_ID Message
    1R1 ABCGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
    1S2 DKILPWLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL

    and so on.
    Last edited by irfanparbatani; 09-05-2013 at 01:15 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Select & Display editable table via dropdown box
    By -AJ- in forum Excel General
    Replies: 2
    Last Post: 06-16-2013, 02:30 PM
  2. Replies: 1
    Last Post: 10-27-2012, 02:54 AM
  3. [SOLVED] I need a message box to open up and display a message before printing.
    By Bobp84 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-16-2012, 01:34 PM
  4. Extracting mail message(outlook) table in the message body
    By andywsw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2012, 10:14 PM
  5. Why Error Message "End Select without Select Case"?
    By GoFigure in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-08-2005, 08:30 PM

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