set focus on 1st item in combo box & error handling

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brent78
    New Member
    • Mar 2007
    • 13

    #1

    set focus on 1st item in combo box & error handling

    I have 2 questions.

    1)How can I do a setfocus on the first item in a combo box populated with a query. I figured I could somehow use the index of 0 but I can't figure out the syntax to do it.
    2)I set up error handling on a subform that requires a field in the main subform to be clicked. If the user doesn't select one I get the constraint violation. How can I cause the subform to default back to as if nothing was typed there. Basically automating pressing the escape key to back out of the form and prevent changes.
    I have the error control in there, I just don't know the syntax to undo changes to the subform.
    Thanks.
  • PianoMan64
    Recognized Expert Contributor
    • Jan 2008
    • 374

    #2
    In regards to your Dropdown list, just simply set the value of the field that you're doing the lookup on to the value that is in the list. If this is something different for each use of the form, then that get's a little more complicated.

    As for the error handling, if you simply set the value in the first question, you avoid the second problem all together.

    Hope that helps,

    If you need more help, PM me on this site.

    Joe P.

    Comment

    Working...