Reusing Code

Results 1 to 3 of 3

Thread: Reusing Code

  1. #1
    Join Date
    Dec 1969

    Default Reusing Code

    I&#039;ve got 2 combo boxes on a form that are populated from a recordet. I want to use the same recordset results to populate both combo boxes, but I don&#039;t really want to write 2 blocks of code, I tried putting the code in a function and using the dB connect stirng as an include, but I keep getting Variables already defined errors, what&#039;s the best way to do this ?? <BR><BR>many thanks ..

  2. #2
    Join Date
    Dec 1969

    Default RE: Reusing Code

    Well it is a good idea to use a function to create the drop-down boxes. I have a number of standard functions in an include file for creating all the controls I use on my pages, and just call them as needed.<BR><BR>The error you are getting is pretty clear, you have defined a variable more than once. Make sure that none of the variables in your include file are also defined in your page.<BR><BR>BTW, you should use Getrows to turn the recordset into an array as it will perform better than having to navigate the recordset twice.

  3. #3
    Join Date
    Dec 1969

    Default Your Code interest me

    Eddie,<BR><BR>I found your solution very clever, I am also struggling with drop-down boxes solution. Could you post me your code? I would appreciate.<BR>Pascal<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts