Results 1 to 3 of 3

Thread: MS Access / VBScript Question

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    1

    MS Access / VBScript Question

    I am trying to write a code in MS Access 2000 using VBScript that will allow me to check a checkbox on a form automatically whenever a certain value of a drop down field is selected on a higher level form. Any ideas, suggestions or tips that would be helpful???

  2. #2
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016
    Say we have Form1 and Form2. Form1 contains your check box(Check1) and Form2 contains the combobox(cbo). In the After Update event of the combobox, you would need:
    VB Code:
    1. If cbo.Value > 5 Then
    2.    [Forms]![Form1]!Check1.Value = 1
    3. Else
    4.    [Forms]![Form1]!Check1.Value = 0
    5. End If

    This should get you pointed in the right direction.
    Chris

    Master Of My Domain
    Got A Question? Look Here First

  3. #3
    Hyperactive Member
    Join Date
    Mar 2002
    Posts
    424
    If that doesn't work, set the value of the checkboxes with True and False as the numeric equivalent is 0 (false) and -1 (True) and this sometimes is confusing.

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