Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    48

    Unanswered: If statment...Report

    Hi, this may be an easy question.
    On a report I want a text field to be visible on the report if a certain option box was selected on a form.

    if Forms![frmncr]![grpcode].value = 1 then
    txtbox1.visible = true
    txtbox2.visible = false
    elseif Forms![frmncr]![grpcode].value = 2 then
    txtbox1.visible= false
    txtbox2.visible = true
    .......

    something like this,

    Thanks

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Put your code in the OnFormat event of your detail section.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    Here is another way you can write the code:

    txtbox1.visible = Forms![frmncr]![grpcode].value = 1
    txtbox2.visible = Forms![frmncr]![grpcode].value = 2
    .
    .
    .

    In my opinion it is a little easier to read.

Posting Permissions

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