Results 1 to 3 of 3

Thread: Simple Q

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2004
    Posts
    8

    Simple Q

    I am using Access I would like to know if there is a method that you can use to initialise the form controls

    .......

    So basically I am after a method that will automatically run as soon as the user opens the form, then that method can initialise things like control default values and combo box list items. (I know that both of those can be done other ways but I would like to do them in VBA)

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    VB Code:
    1. Private Sub Form_Open(Cancel As Integer)
    2.     Forms!MyFormNameHere!Text1.SetFocus
    3.     Text1.Text = "Hello world"
    4.    
    5.     MsgBox "Done setting form control values, " & _
    6.     "now showing the form to the user..."
    7. End Sub

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2004
    Posts
    8
    thanx alot for your speedy reply!

Posting Permissions

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



Click Here to Expand Forum to Full Width