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
Reference Data In XML Document
Scope_Identity in SELECT statement with a WHERE clause
Recalc field on an open form when close a second form.
Patient Days Across Multiple Months
Exchange Service Pack 2 Removal
Use xml parameter in SQL Server select
Cybersource Error 80070005 System.UnauthorizedAccessE<wbr />xception: Retrieving the COM
Improving as a Programmer
Tool to copy Microsft server to a virtual server
Add multiple domain in Exchange server 2010