value on a form not being used

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bobh

    value on a form not being used

    Hi All,

    In AccessXP I have a form, the user selects stuff and in a hidden
    unbound textbox(bxOfcCd e) I create an 'In' statement like
    In('1f','mf')

    then on the click event of a button I run a query which uses the
    string above as criteria in the Ofc_Cde field with a usual reference
    on the criteria line like [Forms]![frmMainMenu]![bxOfcCde]

    but it's not working, the query returns 0 records yet if I type the
    same string In('1f','mf') in the criteria of Ofc_Cde directly and
    run the query I get records.

    What am I missing??

    thanks
    bobh.

  • Clint Stowers

    #2
    Re: value on a form not being used

    On Oct 26, 2:51 pm, bobh <vulca...@yahoo .comwrote:
    In AccessXP I have a form, the user selects stuff and in a hidden
    unbound textbox(bxOfcCd e) I create an 'In' statement like
    In('1f','mf')
    >
    then on the click event of a button I run a query which uses the
    string above as criteria in the Ofc_Cde field with a usual reference
    on the criteria line like [Forms]![frmMainMenu]![bxOfcCde]
    >
    but it's not working, the query returns 0 records yet if I type the
    same string In('1f','mf') in the criteria of Ofc_Cde directly and
    run the query I get records.
    Perhaps a Me.Refresh AfterUpdate might help.

    Comment

    • Salad

      #3
      Re: value on a form not being used

      bobh wrote:
      Hi All,
      >
      In AccessXP I have a form, the user selects stuff and in a hidden
      unbound textbox(bxOfcCd e) I create an 'In' statement like
      In('1f','mf')
      >
      then on the click event of a button I run a query which uses the
      string above as criteria in the Ofc_Cde field with a usual reference
      on the criteria line like [Forms]![frmMainMenu]![bxOfcCde]
      >
      but it's not working, the query returns 0 records yet if I type the
      same string In('1f','mf') in the criteria of Ofc_Cde directly and
      run the query I get records.
      >
      What am I missing??
      >
      thanks
      bobh.
      >
      I don't know. I tried various methods myself. I could come up one that
      works like this
      Me.bxOfcCde = ",1f,mf,"
      Then in the criteria
      Instr([frmMainMenu]![bxOfcCde],"," & [Ofc_Cde] & ",") 0

      Comment

      Working...