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. To generate reusable code

To generate reusable code

Scheduled Pinned Locked Moved Visual Basic
questiondatabase
2 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.
  • S Offline
    S Offline
    Softtips2004
    wrote on last edited by
    #1

    I am retrieving a field from the database into a combobox.I have to retrieve the same data into the combobox in 3 different forms.How can i simplify this.Do i write a common procedure?

    M 1 Reply Last reply
    0
    • S Softtips2004

      I am retrieving a field from the database into a combobox.I have to retrieve the same data into the combobox in 3 different forms.How can i simplify this.Do i write a common procedure?

      M Offline
      M Offline
      mikasa
      wrote on last edited by
      #2

      This all depends on how your Forms are related. Sometimes, if one Form is an Extension of another, simply use "Visual" Inheritance. Typically, I write individual Sub Routines for each ComboBox (as opposed to one Massive Routine that Refreshes all Data in every control...blech!). If this is your case, and it seems you are using this in more than one Form, place your Routine in a Module and Pass the ComboBox as a Parameter so it can fill the correct one.

      'In Module...

      Public Sub RefreshCityList(ByRef CboList As ComboBox)
      'Place Logic Here...
      End Sub

      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