Results 1 to 14 of 14
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Hide Prompt (2003)

    On a report, I have a field which prompts for a password. Based on the password, a signature image appears. How would I hide the prompt if a control met a certain criteria? Say Customer Name=Smith.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hide Prompt (2003)

    You'd have to take care of that on a form, before the report opens.

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Hide Prompt (2003)

    Even if the password control is only on the report, and not part of a table or query.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hide Prompt (2003)

    Have you created the prompt by setting the control source of a text box to something like

    =[Enter Password]

    If so, I don't think you can suppress the prompt. Hence my suggestion. Or have you created the prompt in another way?

  5. #5
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Hide Prompt (2003)

    Yes, that's how I've done it. I'm going to have to think about it differently. Thanks Hans.

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide Prompt (2003)

    How does the [Enter Password] prompt work? Because if I set a text box control source to =[Enter Password], the text box displays #Name? Or does the report record source have an input parameter which is referenced in the text box control source?

  7. #7
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide Prompt (2003)

    Oh yes, I understand now that's the case. Clever <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hide Prompt (2003)

    You can also use a parameter that is not part of the record source of the report, but this only works if the report does have a record source. If the report is unbound, you'll get #Name.

  9. #9
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Hide Prompt (2003)

    If I can't hide the prompt, can I just hide the image if the password is entered. You may think this is a stupid request, but we are trying to cover every eventuality, and make it fool proof. This problem is related in a way to <post#=675098>post 675098</post#>, we need to hide the signature image for the two parts beginning 5R or 5D. The code I've got is:-

    If me.password = "whatever" then
    me.signature.visible = true
    else
    me.signature.visible = false

    If the user doesn't type in a password, no signature appears, but we can't rely on that happening. This is why I need the code to test what the parts are, and hide the signature.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hide Prompt (2003)

    You could add a test:

    Me.signature.Visible = (Me.password = "whatever" And (conditions depending on the part are met))

  11. #11
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide Prompt (2003)

    I must be missing something...if I type =[Enter Password] for example in the control source for the EmployeeNumber text box of the startup form in the attached mdb, I still get #Name? Or is that valid only for reports?
    Attached Files Attached Files

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hide Prompt (2003)

    This entire thread is about reports. Yes, a parameter prompt as control source for a text box works only in a bound report, not in a form, whether bound or unbound. There is no need to use it in a form, since the user can enter data directly into a text box. In a report, however, you cannot type in text boxes.

  13. #13
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide Prompt (2003)

    Another useful piece of information I wasn't aware of. Thank you Hans <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  14. #14
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Hide Prompt (2003)

    Thanks Hans. Only just got round to trying the code, and that's worked fine. Thanks again.

Posting Permissions

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