M
mtpiper
Access97 on WinXP pro.
I know very little about VB and got this far by cutting and pasting
from various sources. This is part of a command button on a form that
a person uses to check in for a shift. It sends a Winpopup to another
computer and everything worked ok until I ran it on a Win98 machine
and discovered that Win98 can't use the netapi32.dll (Runtime error
453). Is there an equivalent for Win98? I've tried srvapi.dll
(suggested from another posting) but no luck.
Thanks for your help.
Private Declare Function NetMessageBufferSend Lib _
"NETAPI32.DLL" _
(servername As Any, _
msgname As Byte, _
fromname As Any, _
buf As Byte, ByVal _
buflen As Long) As Long
Private Sub Command10_Click()
Dim bMessage() As Byte
Dim bDestination() As Byte
If IsNull(EmpNo) Or (EmpNo) = 0 Or IsNull(TripNo) Then
MsgBox "All Fields Must Be Completed", vbOKOnly, "Missing Data"
EmpNo.SetFocus
Else
ChekInTime.Value = Now()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
Exit_Command10_Click:
MsgBox "Emp #" & EmpNo & " Checked-in at: " & Format(Now, "mm/dd
hh:mm"), vbOKOnly, "Check-in Time"
bMessage = "Emp # " & Me!EmpNo & " checked in at " & Format(Now,
"mm/dd hh:mm") & vbNullChar
bDestination = "SCHEDULING" & vbNullChar
DoCmd.Hourglass True
If Not ( _
NetMessageBufferSend(ByVal 0&, _
bDestination(0), ByVal 0&, _
bMessage(0), UBound(bMessage)) = 0) _
Then MsgBox "Message Failed"
DoCmd.Hourglass False
DoCmd.Close
DoCmd.OpenForm "Switchboard"
Exit Sub
End If
I know very little about VB and got this far by cutting and pasting
from various sources. This is part of a command button on a form that
a person uses to check in for a shift. It sends a Winpopup to another
computer and everything worked ok until I ran it on a Win98 machine
and discovered that Win98 can't use the netapi32.dll (Runtime error
453). Is there an equivalent for Win98? I've tried srvapi.dll
(suggested from another posting) but no luck.
Thanks for your help.
Private Declare Function NetMessageBufferSend Lib _
"NETAPI32.DLL" _
(servername As Any, _
msgname As Byte, _
fromname As Any, _
buf As Byte, ByVal _
buflen As Long) As Long
Private Sub Command10_Click()
Dim bMessage() As Byte
Dim bDestination() As Byte
If IsNull(EmpNo) Or (EmpNo) = 0 Or IsNull(TripNo) Then
MsgBox "All Fields Must Be Completed", vbOKOnly, "Missing Data"
EmpNo.SetFocus
Else
ChekInTime.Value = Now()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
Exit_Command10_Click:
MsgBox "Emp #" & EmpNo & " Checked-in at: " & Format(Now, "mm/dd
hh:mm"), vbOKOnly, "Check-in Time"
bMessage = "Emp # " & Me!EmpNo & " checked in at " & Format(Now,
"mm/dd hh:mm") & vbNullChar
bDestination = "SCHEDULING" & vbNullChar
DoCmd.Hourglass True
If Not ( _
NetMessageBufferSend(ByVal 0&, _
bDestination(0), ByVal 0&, _
bMessage(0), UBound(bMessage)) = 0) _
Then MsgBox "Message Failed"
DoCmd.Hourglass False
DoCmd.Close
DoCmd.OpenForm "Switchboard"
Exit Sub
End If