Hi there,

I'm pretty new to VB6 and used to work with Access VBA, so please bear with me.
At the moment I'm trying to have VB execute a command with some command line parameters. One of these parameters is taken from a textbox. For some reason the correct command is displayed in a msgbox, but when I try to have VB execute it, it doesn't do this correctly.
This is my code:
Code:
Private Sub username_LostFocus()
Dim sYourCommand As String
sYourcommand0 = "C:\iris\encrypt.exe "
sYourCommand1 = username
sYourCommand2 = " > c:\iris\pwoutput1.txt"
MsgBox (sYourcommand0 & sYourCommand1 & sYourCommand2)

    Dim retval As Double
    retval = Shell(sYourcommand0 & sYourCommand1 & sYourCommand2, vbNormalFocus)
End Sub
It seems that only sYourcommand0 is being executed and the rest is left behind. However as mentioned the messagebox does display the correct command while it seems to me that both should display identical.
Any suggestions on how I can have VB execute this command are welcome.

Also, in Access I used the AfterUpdate to perform an action once a textbox was updated, I cannot get this to work in VB6 and therefore used LostFocus. Would anyone have a solution for this?

Kind regards,

Ronald.