Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

weird - shell command executes but does not

Status
Not open for further replies.

kermit01de

Technical User
Jan 20, 2002
256
0
0
DE
Access 2010

The following procedure is on the "after update" event on a checkbox

Code:
Private Sub FertigX_AfterUpdate()
CurrentDb.Execute "INSERT INTO LapLog ([LfdNr], Aktion, Zeit) VALUES (" & LfdNr & ", 'Fertig neu: " & FertigX & "', Now())"

If FertigX = True Then
    If MsgBox("Wirklich FERTIG? Alle Eintragungen zum Anwender vorgenommen?", vbOKCancel, "Wirklich Fertig?") = vbOK Then
     
        Shell "netsend.exe /WINPOPUP A0003372 " & """Achtung: Vorgang " & [User] & " ist fertig zur Eintragung in I T D S"""
    Else
        FertigX = False
    End If
End If
End Sub

netsend.exe is a piece of freeware belonging to WinPopup Messenger. It is residing in System32 folder

When checking the FertigX-box After answering the MsgBox something is happening at the taskbar for 1/2 seconds. I assume that is the shell ...

When copying the command to the cmd-window everything runs fine, message pops up in Winpopup. So the command itself is not wrong.

My question is,
a) why does it not execute correctly from within Access
a1) How to debug that and get back a possible error in the shell?

Thank you.

Mirko

Kind regards
Mirko
--------------------------------------
>>>>>> ... I am sure, some supportissues are a matter of PEBKAC ... <<<<<
 

Have you tried inserting a break point and stepping through the code?


Randy
 

Try:
Code:
Dim RetVal As Long
Dim strSend As String

strSend = "netsend.exe /WINPOPUP A0003372 " & """Achtung: Vorgang " & [User] & " ist fertig zur Eintragung in I T D S"""
[green]
'or[/green]

strSend = "net send " & [User] & " Achtung: Vorgang " & [User] & " ist fertig zur Eintragung in I T D S"""

RetVal = Shell(strSend, 0)

Have fun.

---- Andy
 
@Randy: If I knew how ... When I am in the debugger / module window, I am only able to set a breakpoint - but other as in VB6 I am not able to mark a line and press play to start from there ...

@Andy:
I will try that and come back.

btw: Could it possibly be, because Acc2010 is an AppV - virtual App on the PC?

Kind regards
Mirko
--------------------------------------
>>>>>> ... I am sure, some supportissues are a matter of PEBKAC ... <<<<<
 
So, I tried Andys suggestion - and I get several RetVals, there seems to be no system behind the retVals.

I changed the RetVal = Shell(strSend, 0) to RetVal = Shell(strSend, vbMaximizedFocus). The cmd window pops up - but no message is sent.

What does the RetVal tell me - or what should it tell me?





Kind regards
Mirko
--------------------------------------
>>>>>> ... I am sure, some supportissues are a matter of PEBKAC ... <<<<<
 

What do you mean by "I get several RetVals"? And by "there seems to be no system behind the retVals"? I have no clue what you mean by that.

RetVal (returned value, you can name it anything you want) is a name of the variable, that's all. Did you put (declared):[tt]
Dim RetVal As Long[/tt]
At the top of your code?

Have fun.

---- Andy
 
Yes, I did the Dim.

What happens:
Click checkbox - RetVal = 5148
Click again - nothing -> that is right
Click again - RetVal = 6120
Click again - nothing
Click again - RetVal = 1325

That is, what I mean.

Kind regards
Mirko
--------------------------------------
>>>>>> ... I am sure, some supportissues are a matter of PEBKAC ... <<<<<
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top