Microsoft
Software
Hardware
Network
Question : I have this function, but unable to put results on the form
I want to put the results on a form. Msgbox displays the informatio, but do not know how to transfer the information to my form.
What do I need to do to get the results in my form?
Below is the code:
Option Compare Database
Private Declare Function OpenProcess Lib "Kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "Kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
Private Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Const STILL_ACTIVE = &H103
Const PROCESS_QUERY_INFORMATION = &H400
Private Sub Shell32Bit(ByVal JobToDo As String)
Dim hProcess As Long
Dim RetVal As Long
hProcess = OpenProcess(PROCESS_QUERY_
INFORMATIO
N, False, Shell(JobToDo, vbHide))
Do
GetExitCodeProcess hProcess, RetVal
DoEvents: Sleep 100
Loop While RetVal = STILL_ACTIVE
End Sub
Function findit()
Dim b As String
Dim C As String
Dim D As String
If Dir("C:\tmpp.txt") <> "" Then Kill ("C:\tmpp.txt")
Shell32Bit "command.com /c ipconfig /all > C:\tmpp.txt"
Open "C:\tmpp.txt" For Input As #1
Do Until D = "1"
Line Input #1, b
C = Trim(b)
If Mid(C, 1, 16) = "Physical Address" Then
Line Input #1, b
MsgBox Mid(C, 36, 18)
D = "1"
End If
Loop
Close #1
'If Dir("c:\tmpp") <> "" Then Kill "c:\tmpp"
End Function
Answer : I have this function, but unable to put results on the form
when (on what event) do you want to show the value returned by the function?
me.hold=findit()
Random Solutions
STATUS BAR RESULTS NOT SHOWING.
Microsoft Great Plains V10 Compliant to SOX
is there a difference between C++ in visual studio 2008" and "visual C++ 2008"
ReOrder Priorirty
ORDER BY in UNION query that contains both text and numbers
How can I put the file name and a SHORT path at the bottom of my word 2007 documents?
How can I programmatically get a list of spreadsheets from a MS Excel workbook?
DC not responding to directory service requests
How do I return multiple files in Excel VBA using GetOpenFilename?
UNC Share as an IIS Virtuial Directory