update sql statements using loops

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shokoth
    New Member
    • Apr 2007
    • 29

    #1

    update sql statements using loops

    hi
    is it possible to have an sql statement with a loop. i am trying to update several fields at once based on a form.
    the criteria would be that if the value on the current form is the same value in another table, then set field to .....
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Originally posted by Shokoth
    hi
    is it possible to have an sql statement with a loop. i am trying to update several fields at once based on a form.
    the criteria would be that if the value on the current form is the same value in another table, then set field to .....
    A lot more information is required. Can you give a more detailed explanation of exactly what you are trying to do and when and where it's triggered.

    Comment

    • Shokoth
      New Member
      • Apr 2007
      • 29

      #3
      i have a listbox with employee details, and it is in a form that allows a manager to assign employees to a particular job.
      so when the manager double cicks the list, the employee that he has just clicked, the name on the employee is added to the form, an is added to employee one. once the manger clickes the list again, that employee is added to the form, on the text box employee 2, and so on.

      firstly i am not sure how that would be done, weather a loop statement is required or an if statemnet is required.


      also after an employee has been added, he should be reomoved from that list, and the employee table is updated, by changing the 'Available' field from true to false, for all the employees that have jus been added.

      is that possible?

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Originally posted by Shokoth
        i have a listbox with employee details, and it is in a form that allows a manager to assign employees to a particular job.
        so when the manager double cicks the list, the employee that he has just clicked, the name on the employee is added to the form, an is added to employee one. once the manger clickes the list again, that employee is added to the form, on the text box employee 2, and so on.

        firstly i am not sure how that would be done, weather a loop statement is required or an if statemnet is required.


        also after an employee has been added, he should be reomoved from that list, and the employee table is updated, by changing the 'Available' field from true to false, for all the employees that have jus been added.

        is that possible?
        Having multiple fields for an employee is structurally unsound. These should be put in another table and added using a subform.

        Comment

        Working...