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
  1. Home
  2. General Programming
  3. Visual Basic
  4. Searching Data

Searching Data

Scheduled Pinned Locked Moved Visual Basic
helpalgorithms
3 Posts 2 Posters 0 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.
  • A Offline
    A Offline
    Ahmad Rifai Yusuf
    wrote on last edited by
    #1

    Dear all, I'am trying to build a search program using Excel 2003 Macro, i have trouble when i click this command always shown this message : "Run Time Error '1004': Application-defined or object-defined error". Need your help to check where the wrong syntax code of my program,

    Private Sub cmdCari_Click()
    Set wsDtbsCont = Sheets("DataContainer")
    Set rgDtbsCont = wsDtbsCont.Range("DataContainer")
    Set c = rgDtbsCont.Find(txtContNo.Value, LookIn:=xlValues)
    txtCarrier.Value = c.Offset(0, 1).Value
    cmbForwarder.Value = c.Offset(0, 2).Value
    txtSeal.Value = c.Offset(0, 3).Value
    txtStatus.Value = c.Offset(0, 4).Value
    txtArrivalTime.Value = c.Offset(0, 5).Value
    txtStuffingTime.Value = c.Offset(0, 6).Value
    txtSealTime.Value = c.Offset(0, 7).Value
    txtFreeTime.Value = c.Offset(0, 8).Value
    txtOverNight.Value = c.Offset(0, 9).Value
    End Sub

    thank you for every things..

    Best Regards, Ahmad Rifai Yusuf

    K 1 Reply Last reply
    0
    • A Ahmad Rifai Yusuf

      Dear all, I'am trying to build a search program using Excel 2003 Macro, i have trouble when i click this command always shown this message : "Run Time Error '1004': Application-defined or object-defined error". Need your help to check where the wrong syntax code of my program,

      Private Sub cmdCari_Click()
      Set wsDtbsCont = Sheets("DataContainer")
      Set rgDtbsCont = wsDtbsCont.Range("DataContainer")
      Set c = rgDtbsCont.Find(txtContNo.Value, LookIn:=xlValues)
      txtCarrier.Value = c.Offset(0, 1).Value
      cmbForwarder.Value = c.Offset(0, 2).Value
      txtSeal.Value = c.Offset(0, 3).Value
      txtStatus.Value = c.Offset(0, 4).Value
      txtArrivalTime.Value = c.Offset(0, 5).Value
      txtStuffingTime.Value = c.Offset(0, 6).Value
      txtSealTime.Value = c.Offset(0, 7).Value
      txtFreeTime.Value = c.Offset(0, 8).Value
      txtOverNight.Value = c.Offset(0, 9).Value
      End Sub

      thank you for every things..

      Best Regards, Ahmad Rifai Yusuf

      K Offline
      K Offline
      Kenneth Haugland
      wrote on last edited by
      #2

      The range definition looks stange to me, can you use select all or something like that? I m assuming that your sheet actually excist though, or?

      A 1 Reply Last reply
      0
      • K Kenneth Haugland

        The range definition looks stange to me, can you use select all or something like that? I m assuming that your sheet actually excist though, or?

        A Offline
        A Offline
        Ahmad Rifai Yusuf
        wrote on last edited by
        #3

        Dear Kenneth, The sheet actually exist, i'am trying to search data with cmdCari Command Button with where the key is in txtContNo Text Box, Actually i was interested use select or other SQL Statement, but don't have any references. Do you / any guys have it. Coz i really need it

        Best Regards, Ahmad Rifai Yusuf

        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