Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Auto Suggest

Auto Suggest

Scheduled Pinned Locked Moved Visual Basic
databasequestion
6 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    led123
    wrote on last edited by
    #1

    I am currently trying to add a section of code to auto suggest the next message code (taking the message last one in the database and suggesting the next one to the user) in the text box. Any suggestions?

    S 1 Reply Last reply
    0
    • L led123

      I am currently trying to add a section of code to auto suggest the next message code (taking the message last one in the database and suggesting the next one to the user) in the text box. Any suggestions?

      S Offline
      S Offline
      Steven J Jowett
      wrote on last edited by
      #2

      How are you presenting the suggested message to the end user?

      Steve Jowett ------------------------- Real programmers don't comment their code. If it was hard to write, it should be hard to read.

      L 1 Reply Last reply
      0
      • S Steven J Jowett

        How are you presenting the suggested message to the end user?

        Steve Jowett ------------------------- Real programmers don't comment their code. If it was hard to write, it should be hard to read.

        L Offline
        L Offline
        led123
        wrote on last edited by
        #3

        In a text box on a pop up window.

        S 1 Reply Last reply
        0
        • L led123

          In a text box on a pop up window.

          S Offline
          S Offline
          Steven J Jowett
          wrote on last edited by
          #4

          I would suggest that you need to store an Unique ID column next to each message within your database, or a column for the sequence, (which ever best suits your requirements), the store the last shown message Id somewhere. When you the want to show the next message : SELECT TOP 1 MessageText FROM MessageTable WHERE MessageId > LastMessageId

          Steve Jowett ------------------------- Real programmers don't comment their code. If it was hard to write, it should be hard to read.

          L 1 Reply Last reply
          0
          • S Steven J Jowett

            I would suggest that you need to store an Unique ID column next to each message within your database, or a column for the sequence, (which ever best suits your requirements), the store the last shown message Id somewhere. When you the want to show the next message : SELECT TOP 1 MessageText FROM MessageTable WHERE MessageId > LastMessageId

            Steve Jowett ------------------------- Real programmers don't comment their code. If it was hard to write, it should be hard to read.

            L Offline
            L Offline
            led123
            wrote on last edited by
            #5

            We do not have the permissions to create new columns in the database. We have to go with the column message codes that is already in there.

            D 1 Reply Last reply
            0
            • L led123

              We do not have the permissions to create new columns in the database. We have to go with the column message codes that is already in there.

              D Offline
              D Offline
              Drew Stegon
              wrote on last edited by
              #6

              IF there is not a field that you could use as a comparison, like an ID field, then you could open up the table, search the each record (do loop/for each) for matching text to the current message text and then move to the next record and display that. When you get to EOF, then just go to the first record and display that message. Long way around, but sometimes you are forced to do things in code you nromally would have to do because of bad database design.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups