Results 1 to 10 of 10
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Command Button (form has content) (2002 SP-2)

    I have a continuous form with a (very small) cmdbtn that opens a temporary memo form (looks like a sticky note). What I have been trying to do is have the cmdbtn "caption" ("M") show when there is content in the memo field of frmDispatchMemoTemp, and of course not show when the memo field is empty. Right now I can't tell whether there is a "memo" or not for any particular record.
    <pre>Private Sub cmdDispatchMemoTemp_Click()
    On Error GoTo Err_cmdDispatchMemoTemp_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmDispatchMemoTemp"

    stLinkCriteria = "[ProNo]=" & Me![PRO#]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_cmdDispatchMemoTemp_Click:
    Exit Sub

    Err_cmdDispatchMemoTemp_Click:
    MsgBox Err.Description
    Resume Exit_cmdDispatchMemoTemp_Click

    End Sub</pre>


    In the picture, two of these records have memo's, but I'll be darned if I know which ones!
    Attached Images Attached Images
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

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

    Re: Command Button (form has content) (2002 SP-2)

    Although you see multiple instances of the command button in the continuous form, there is in fact only one button. If you change the caption (or any other property) of the command button, the change will be visible in *all* records.
    The only thing that can change from record to record is the content of a text box, check box or combo box if it is dependent on the data in the current record. A - not very elegant - way to simulate a command button with a changing caption is as follows:
    <UL><LI>Put a text box in the detail section of the form. Remove its label if it has one, you won't need it.
    <LI>Set its Control Source to

    =IIf(IsNull([MemoFieldName]),"","M")

    where MemoFieldName must be replaced by the name of your memo field.
    <LI>Make the text box look like a command button:
    - Set the Text Align property to Center.
    - Set the Special Effect property to Raised.
    - Set the BackColor property to -2147483633 (this is the system color for buttons.)
    <LI>Create an On Click event procedure for the text box to open the memo form. Its code looks just like the code you posted, but with the name of the text box instead of the command button.[/list]The user will see an insertion point in the text box, but won't be able to edit the contents (since those are calculated.)

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Command Button (form has content) (2002 SP-2)

    Hans:

    I suppose beauty is in the eye of the beholder (re: "A - not very elegant - way. . ."), but I happen to think this solution is simply marvelous! It looks and acts just like any other CmdBtn - but with brains. (I did happen to name it txtMemoFauxCmdBtn, "faux" taking nothing from the respect this solution demands, LOL).

    Thanks once again for your elegant solution. Marvelous, simply marvelous!
    Attached Images Attached Images
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Command Button (form has content) (2002 SP-2)

    Hmm. . . anyone happen to know character equivalent (wingding, wingding2, etc) for a check mark? Any way to do this? "M" works just fine, but I think a check mark would be better. I did a Google search, but references all seem to apply to HTML or Unicode. BTW, if you happen to know where I can get a "list" of these characters (that will work in Access) I would appreciate that also.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

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

    Re: Command Button (form has content) (2002 SP-2)

    Lower case "a" in the Marlett font is a check box. Marlett is a Windows system font, so it should be present on all PC's.

  6. #6
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Command Button (form has content) (2002 SP-2)

    See <!post=this post and thread,328269>this post and thread<!/post> for some other thoughts.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  7. #7
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Command Button (form has content) (2002 SP-2)

    Hi,

    If you choose font Wingdings, there are the following alt codes:

    (hold down ALT key and type the number on the number pad)

    0251, 0252, 0253, 0254
    Attached Images Attached Images
    Thanks,

    pmatz

  8. #8
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Command Button (form has content) (2002 SP-2)

    Thanks for the input.
    I tried the Alt+ method, but didn't have any luck. Perhaps it is because the character is in the string of the Control Source?
    Still, I appreciate your advice.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  9. #9
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Command Button (form has content) (2002 SP-2)

    Hans:

    Thanks. Steve's suggestion seems to work just fine also. How do you guy's know this stuff (don't tell me off the top of your head - anything there would just slide off mine). Also, thanks for pointing out the attribute(s) of the CmdBtn. It didn't even ocurr to me that the CmdBtn isn't the actual memo (the code behind the CmdBtn calls the memo form by the unique ProNo). Another fine lesson you have taught me!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  10. #10
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Command Button (form has content) (2002 SP-2)

    Thanks Steve! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>
    Wingdings2, "P" , font-size 12, works perfectly. I very much appreciate your input.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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