If DCount("connection", "MasterCellDevices", "[connection]='" & Me.txt_InvConnectionPhone & "'") > 0 Then
Set rsMasterCellList = ("SELECT MasterCellDevices.[KioskID] FROM MasterCellDevices WHERE MasterCellDevices.[connection] = " & Me.txt_InvConnectionPhone & "")
If Not IsNull(rsMasterCellList) Then
DupConnection = MsgBox("This number is already assigned to a kiosk.") 'Display if cell number is in KioskCellInstall
Else
rsKioskCellInstall.Edit
rsKioskCellInstall!WanConnection = "AT&T CP"
rsKioskCellInstall!phonenumber = Phone
rsKioskCellInstall.Update
Me.txt_ConnectionType = rsKioskCellInstall!WanConnection
Me.txt_ConnectionPhone = rsKioskCellInstall!phonenumber
End If
Else
WanConnection = MsgBox("Phone number does not exist in Master Cell Devices. Please double check the number.")
Me.cmd_UpdateCell.SetFocus
End If
Private Sub cmd_UpdateCell_Click()
Dim WAN As String
Dim Phone As String
Dim rsKioskCellInstall As DAO.Recordset
Dim db As Database
Dim rsMasterCellList As DAO.Recordset
Dim WanConnection As String
Dim shortphone As String
Dim DupConnection As String
Set db = CurrentDb()
Set rsKioskCellInstall = db.OpenRecordset("SELECT tbl_KioskCellInstall.* FROM tbl_KioskCellInstall WHERE tbl_KioskCellInstall.[KioskID] = " & Me.txt_IDNum & "")
WAN = InputBox("Please enter corresponding number:" & vbCrLf & vbTab & vbCrLf & vbTab & "1 - AT&T CP" & vbCrLf & vbTab & "2 - Default Password" & vbCrLf & vbTab & "3 - Stores Internet" & vbCrLf & vbTab & "4 - Unknown" & vbCrLf & vbTab & "5 - Verizon 760" & vbCrLf & vbTab & "6 - Verizon CP")
If WAN = "" Then
Me.cmd_UpdateCell.SetFocus
ElseIf WAN = 1 Then
Phone = InputBox("Please enter the 11 digit phone number:")
Me.txt_InvConnectionPhone = Phone
If Len(Me.txt_InvConnectionPhone) <> 11 Then
shortphone = MsgBox("Please enter an 11 digit phone number.", vbOKOnly)
ElseIf Len(Me.txt_InvConnectionPhone) = 11 Then
If DCount("connection", "MasterCellDevices", "[connection]='" & Me.txt_InvConnectionPhone & "'") > 0 Then
Set rsMasterCellList = ("SELECT MasterCellDevices.[KioskID] FROM MasterCellDevices WHERE MasterCellDevices.[connection] = " & Me.txt_InvConnectionPhone & "")
If Not IsNull(rsMasterCellList) Then
DupConnection = MsgBox("This number is already assigned to a kiosk.") 'Display if cell number is in KioskCellInstall
Else
rsKioskCellInstall.Edit
rsKioskCellInstall!WanConnection = "AT&T CP"
rsKioskCellInstall!phonenumber = Phone
rsKioskCellInstall.Update
Me.txt_ConnectionType = rsKioskCellInstall!WanConnection
Me.txt_ConnectionPhone = rsKioskCellInstall!phonenumber
End If
Else
WanConnection = MsgBox("Phone number does not exist in Master Cell Devices. Please double check the number.")
Me.cmd_UpdateCell.SetFocus
End If
End If
End If
End Sub
Open in new window
»bp