Results 1 to 8 of 8
  1. #1
    UserX is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2014
    Posts
    30

    Command button on form a to perform function on form b

    What I'm trying to accomplish is either:



    1. Modify the vb button text; or
    2. Create a form that mimics the vb message box

    On Transmittal_Log1, the button under the label "Clear" has the vbYesNo message box. I have made the necessary code adjustments to accomplish the tasks I want to happen, but I would prefer the message box button text to be: Clear "Sent" and Clear "Conf", respectively. I read on another forum of a Class module capable of doing this, but couldn't figure out how to call the sub routine within the Class.

    As an alternative to above, I tried creating a form with two buttons, with the desired text on the buttons, but for the life of me I can't figure out how (if at all possible) to make the on click event for 'Clear "Sent"' point back to Transmittal_Log1, and then make this happen:

    Code:
    Me.GraphicStatusID = conClearWhite
        Me.Date_Fwd_to_PPSO = Null
        DoCmd.RunCommand acCmdSaveRecord
    and likewise for 'Clear "Conf"'
    Code:
    Me.GraphicStatusID = conSentYellow
        Me.Date_JPPSO_Rcvd = Null
        DoCmd.RunCommand acCmdSaveRecord
    Thoughts?
    Attached Files Attached Files
    Last edited by UserX; 10-08-2014 at 07:57 PM. Reason: Correct spelling of "Thoughts" (was "Thoughs")

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,965
    Remove Me from each of the lines in the Form1 code:

    Forms!Transmittal_Log1Me.GraphicStatusID = conClearWhite

    should be

    Forms!Transmittal_Log1.GraphicStatusID = conClearWhite
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    UserX is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2014
    Posts
    30
    June7,

    As always, you've been a great help. Removing "me" certainly did the trick. I truly appreciate your assistance. Is there a way around having to spread rep points? Meaning, since as of late, you've been the only one answering my posts, and helping me with my dbs, you should be the one to get the rep points.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,965
    Rep points not really a big deal, not like I win a sweeps or something - it's an indicator to other readers for reliability of advice and feedback to me.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    UserX is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2014
    Posts
    30
    June7,

    I'm sorry, one more thing on the matter... The 'conf' button, when clicked doesn't work the way I had hoped. Although the date is removed from the proper location, the first line of the code:

    <code>Forms!Transmittal_Log1.GraphicStatusID = conSentYellow</code>

    does not change the GraphicStatus textbox to yellow. Instead, the box goes white. You think you could help me get GraphicStatus to change to yellow as if I had clicked on the "S" button on the Transmittal_Log1 form?

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,965
    Unless you need more than 3 rules for conditional formatting, should be able to use Conditional Formatting without the ApplyCondFormatting() procedure. (BTW, Access 2010 increased the number of rules to 50.)

    The code only affects the current record. Shouldn't every record show coloring if meet condition?

    I think what you need to do is use the value of some field in the Conditional Formatting rule, such as the GraphicStatusID field.
    Right now the rule uses an expression I've never seen: "[cmdSent]_Click"=True
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    UserX is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2014
    Posts
    30
    Thanks! Changed all references of yellow to vbYellow, and voila.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,965
    Ooops, looks like you read my post before major edits.

    Oh well, if you are happy with results...
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-11-2012, 11:52 AM
  2. Filter form with command button
    By NISMOJim in forum Forms
    Replies: 6
    Last Post: 10-22-2011, 02:29 AM
  3. Form command button to do something/call function
    By shubhamgandhi in forum Programming
    Replies: 2
    Last Post: 07-27-2011, 04:45 PM
  4. Export Command Button in Form
    By jjmartinson in forum Forms
    Replies: 3
    Last Post: 08-25-2009, 01:28 AM
  5. Adding Command Button To Form
    By uneek78 in forum Forms
    Replies: 7
    Last Post: 03-27-2009, 07:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums