Results 1 to 14 of 14

Thread: [Resolved] Passing datas form form

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    7

    Resolved [Resolved] Passing datas form form

    Hi,

    I'm really new in VBA World.
    I'm user of Reflection form WRQ who has a VBA support inside.

    I've created a form with buttons.

    The button has to send a command in the terminal.

    I'm using this one

    VB Code:
    1. Session.Transmit Me.Cmd3.Text & vbCr

    But the value CMD3.Text is only sent AFTER I've closed my Form.

    I need to send the command as soon as the user click on the button.

    Is there a way to do that ?

    (PS : Sorry for bad English)

    Cedric
    Last edited by DecIRC; Apr 14th, 2005 at 09:23 AM.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Passing datas form form

    Welcome to the Forums.

    Do you have a Cmd3_Click event avaliable to you? If so place your code in that procedure to fire the transmission when clicked.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    7

    Re: Passing datas form form

    Thanks for the answer, but

    My button name is GO3
    A text field just near this button is call Cmd3
    The routine complete is

    VB Code:
    1. Private Sub GO3_Click()
    2.  
    3. Session.Transmit Me.Cmd3.Text & vbCr
    4. Cmd3.BackColor = &H8000000F
    5.  
    6. End Sub

    If i put Cmd3_Click, my button will become useless, no ?

    Cedric

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Passing datas form form

    Sorry for the mixup. Usually there is a naming convection used to help tell whatt the control type is by its prefix name.

    Use your code if GO3 is the button name.
    Is the event firing? Place a breakpoint on the Private Sub GO3_Click() line.

    VB Code:
    1. Private Sub GO3_Click()
    2.     Session.Transmit Me.Cmd3.Text & vbCr
    3.     Cmd3.BackColor = &H8000000F
    4. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    7

    Re: Passing datas form form

    Sorry for not respecting conventions

    The event itself seems to work.

    The command in the text field is sent perfectly. But only after the closing of the form. Not directy. The second line works also (but immediately) (the change of color of the form).

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Passing datas form form

    Ok, looks like the Session.Transmit is the issue so either its designed that way or there is something else to it.
    I am not familar with "Reflection form WRQ" app but do you have any documentation on the Session.Transmit?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    7

    Re: Passing datas form form

    Here is the help page provided

    Code:
    Syntax	object.Transmit String, [Options]
    
    Description
    
    Transmits a string to the host.
    
    Arguments
    
    String	Argument Type: String
    Required
    Specifies the string to transmit. 
    Options	Argument Type: Enumeration
    Optional
    Specifies additional behavior for the method. You can combine two or more options using addition as shown here:
    
    .Transmit "Hello", rcNoTranslation + rcIgnoreBlockMode
    
    rcNoTranslation
    
    Indicates that the string should not be translated from the PC character set into the host character set.
    
    rcIgnoreBlockMode
    
    Indicates that keyboard text should be transmitted even if Reflection is in block mode. Without this option, transmitted data goes into display memory when Reflection is in block mode.
    
    rcDecodePassword
    
    Use rcDecodePassword to transmit encoded passwords to the host. Passwords are encoded when they are recorded by the Reflection recorder to ensure that they cannot be read in the source code of the recorded procedure. (The recorder records passwords only when SavePasswords is True.) Encoded passwords are also returned by the GetPassword method. Note: This option is ignored if you are transmitting a password that is not encoded.
    
    rcHexData
    
    Indicates that portions of a string that follow a backslash should be interpreted using either hexadecimal code or C-language character conventions. For example, the following statement displays the fraction symbol ¼ (using the decimal code x0BC), followed by a carriage return (using the \r special character). 
    
    .Display "\x0BC\r", rcHexData
    I've tried with or without the rcIgnoreBlockMode, the result is the same.

    and for the object parameter :


    Code:
    Description
    
    The Session object controls the Reflection session. All of Reflection's methods and properties act on the Session object.

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Passing datas form form

    Ok, looks like the rcIgnoreBlockMode parameter is what I would have tried too.
    How about the Reflection session. Is there something in there that looks like it could set how the transmission is carried out?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    7

    Re: Passing datas form form

    already looked in the manual, didn't see anything

    I hope it's possible, all the rest of the interface is finished (creation of the content of all the cmdX fields). Just need to parse them to the console....

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Passing datas form form

    Ok, one last possibility. How are you displaying your user form? Can you post the code?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    7

    Re: Passing datas form form

    If I remember (I left the office now until tomorrow)

    show.smsform

    or

    smsform.show (not sure anymore)

    called from a macro (single line of code in the macro, between Sub and End Sub).

    and the macro called from a menu in the application

    (smsform is of course the name of my form)

    Cedric

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Passing datas form form

    In Office VBA, the UserForm.Show method's default state is vbModal.
    Try changing this to vbModeless. Just a hunch I guess you could call it

    VB Code:
    1. UserForm1.Show vbModeless
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  13. #13

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    7

    Re: Passing datas form form

    Damned ! You've saved my life : IT WORKS !!!

  14. #14
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [Resolved] Passing datas form form

    w00t w00t! I thought that maybe the form was being shown modally (default) and when that happens
    it can delay certain messages to/from the form until it is closed. I just was a little unsure since its not a
    standard Office VBA app.

    Glad to have helped
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width