Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Posts
    6

    Question Unanswered: Using Screen.PreviousControl.SetFocus how I get the value in the Control.!!!!!

    Hi,
    I have disabled a Default Filter buttons in my
    Access97 Form and instead have a command button that
    when clicked Filters the form. I am using the
    following to filter in the Click event of the command
    button.

    Screen.PreviousControl.SetFocus
    DoCmd.RunCommand
    acCmdFilterBySelection

    Now my problem is I also want to get the current
    selected value of the control and run a SQL Query
    according to that value also i.e. after

    Screen.PreviousControl.SetFocus

    I want to get the value of that control also and store
    it somewhere. Currently I have lot of different
    controls on the Form CheckBoxes, ComboBoxes, TextBoxes
    etc. Means when I
    say
    Screen.PreviousControl.SetFocus

    on the previous control is there any way I get the
    current value shown in the control also and then after
    that execute my
    DoCmd.RunCommand acCmdFilterBySelection
    statement.

    Thanks for any help.
    Screen.PreviousControl.SetFocus

  2. #2
    Join Date
    Nov 2001
    Posts
    336
    Try

    Screen.PreviousControl.SetFocus
    Msgbox "Value=" & Screen.ActiveControl
    DoCmd.RunCommand acCmdFilterBySelection

    Igor

Posting Permissions

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