Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2008
    Posts
    101

    Unanswered: Memo/ Notes data help

    Hi, I need some help on something, i have a memo box on my form for me to add notes to the customers record and would like the data to be hidden until a button is pressed, the button in question when pressed at the moment it adds a value to certain fields...i.e the time, date and 2 character initial of the person who pressed it. the record then updates with the relevant info. what i would like is a 4th function which unhides the data from the memo box so that until the button is pressed nobody can see what notes the customer has.
    thanks

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    Me.SomeTextBox.Visible = True
    ??
    George
    Home | Blog

  3. #3
    Join Date
    Sep 2008
    Posts
    101
    how would this work for the macro that i have running which does the first 3 functions?
    thanks

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Right click the Macro and chose Save As... Module.

    Nick the code from there and stick it behind your command button (where you can bolt on the .Visisble bit)
    George
    Home | Blog

  5. #5
    Join Date
    Sep 2008
    Posts
    101
    cheers geordev, would this only show the memo notes on the current record? and keep all the other memo notes hidden for the other records until the button is pressed again?

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you are going to need to dabble with a bit of code behind the form. you need to place some VBA in the appropriate event handlers to do what you want.

    if you need to hide or unhide somehtign in Access the command is
    mycontrolname.visible and set the value as either TRUE or FALSE

    eg
    mycontrolname.visible=true

    you need to se that value when the record is changed, use the oncurrent event of the form detail.

    behind the button press you can toggle the visitbility of the memo control
    if the control was visible, now hide it, if it wasn't visible now show it (and add the time. that goes in the buttons on click event

    if mycontrolname.visible = true then ' we have jsut finished editing or viewing the customer comments
    mycontrolname.visible = false 'sp hide the comments
    else 'the control was hidden so we need to show the comments
    mycontrolname.visible =true
    mycontrolname.text = mycontrolname.text & vbcrlf 'add a new line
    mycontrolname.text = mycontrolname.text & format (now(), "dd mmm yyyy @ HH:MMS" & myuserintials & " wrote:...." & vbcrlf
    endif

    I think you need to give some consideration of wehre you pull the initials from
    If its a customer comment form it may be better to make the customer comments a sub/child table with one row per comment... so people can't overwrite comments. you could then move the date and timestamp and userid as separate data in their own right. to me the advantage of this approach, you can stop other people overwriting exsting comments eiother deliberately on inadvertantly. you can pull the netwrok userid of the logged on user so you dont' have to consider who actually made the comment. the downside is that you will have to have one logged on user and not allow users to share a logon.
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Sep 2008
    Posts
    101
    Thanks healdem and georgev looks like a got my work cutout...the code i was gonna use:

    Private Sub run_macro_g_Click()

    '------------------------------------------------------------
    ' AA1
    '
    '------------------------------------------------------------
    Function AA1()
    On Error GoTo AA1_Err

    Forms!Workflow![Date 1st Call made] = Date
    Forms!Workflow![Time 1st Call made] = Time()
    Forms!Workflow!Owner = "AA"
    DoCmd.RunCommand acCmdRefresh
    Me.SomeTextBox.Visible = True


    AA1_Exit:
    Exit Function

    AA1_Err:
    MsgBox Error$
    Resume AA1_Exit

    End Function

    but i guess this wouldnt work now as it would always show the field once the button is pressed?

  8. #8
    Join Date
    May 2008
    Location
    Raleigh, NC
    Posts
    151

    Hey George...

    Who is Nick?

    --If its free, take it for what its worth!

  9. #9
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by gmc2k2
    but i guess this wouldnt work now as it would always show the field once the button is pressed?
    Explain please?
    Quote Originally Posted by stuschmied
    Who is Nick?
    Nick, you know Nick! Nick "The Code" (duhh)
    George
    Home | Blog

  10. #10
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by georgev
    Explain please?

    Nick, you know Nick! Nick "The Code" (duhh)
    AKA copy/steal/grab the code from there and paste it somewhere else
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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