Hi,
I have a new event procedure (below) which works absolutely fine for me but fails on my two Runtime users
Has anyone had similar issues with Runtime as its the first time its happenened to me
Just wonder if anyone can see any issues thanks
Private Sub InTest_Click()
'STATUS "Deleting Previous Import Table" - STAGE1
On Error Resume Next
DoCmd.DeleteObject acTable, "NISFeatureData2"
On Error GoTo 0
'IMPORTING SHEET - STAGE2
'DoCmd.TransferSpreadsheet acImport, , "NISFeatureData2",
"C:\Users\accounts_2\OneDrive - PM\NIS-IRN\" & Me.CustomerIRN & ".xlsx", False
'DELETING HEADER ROWS - STAGE3
Dim rs As Recordset, done As Boolean, S As String
Set rs = CurrentDb.OpenRecordset("NISFeatureData2")
done = False
While Not rs.EOF And Not done
S = Nz(rs!F1, "")
If S = "Dim" Then done = True
rs.Delete
rs.MoveNext
Wend
rs.Close
'LOOP THRU VALID Dim
Dim FoundEnd As Boolean
Set rs = CurrentDb.OpenRecordset("NISFeatureData2")
FoundEnd = False
While Not rs.EOF
S = Nz(rs!F1, "")
If S = "Comments & Photos:" Then FoundEnd = True
If FoundEnd Then rs.Delete
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
'UPDATE FEATURE DATA - STAGE4
DoCmd.OpenQuery "NISFeatureDataAQ", acViewNormal, acReadOnly
DoCmd.RunCommand acCmdRun
DoCmd.OpenQuery "NISFeatureData1UQ", acViewNormal, acReadOnly
DoCmd.RunCommand acCmdRun
DoCmd.RunMacro "NISNextRecordBack1"
DoCmd.RunMacro "NISFeatureTextRemove1"
DoCmd.RunMacro "NISNextRecordBack1"
'UPDATE COMPONENTS - STAGE5
Dim db As DAO.Database
Set db = CurrentDb()
DoCmd.RunMacro "NISNextRecordBack1"
Wait 1
DoCmd.RunMacro "NISAppComponentNumber1"
Wait 1
Me.CompQty.SetFocus
If Me.CompQty & "" > 0 And Me.CompQty <= DMax("TallyNum", "tblTallyNumbers") Then
Else
MsgBox " Component Qty is required and must be <= the Max value in tblTallyNumbers", vbOKOnly
Me.CompQty.SetFocus
Exit Sub
End If
'UPDATE INSPECTION - STAGE6
DoCmd.RunMacro "NISAppItemComp1"
Wait 1
DoCmd.RunMacro "NextRecordNISComp1"
Wait 1
'HIDE INTEST BUTTON - STAGE7
OrderNumber.SetFocus
InTest.Enabled = False
InTest.Transparent = True
End Sub
I have a new event procedure (below) which works absolutely fine for me but fails on my two Runtime users
Has anyone had similar issues with Runtime as its the first time its happenened to me
Just wonder if anyone can see any issues thanks
Private Sub InTest_Click()
'STATUS "Deleting Previous Import Table" - STAGE1
On Error Resume Next
DoCmd.DeleteObject acTable, "NISFeatureData2"
On Error GoTo 0
'IMPORTING SHEET - STAGE2
'DoCmd.TransferSpreadsheet acImport, , "NISFeatureData2",
"C:\Users\accounts_2\OneDrive - PM\NIS-IRN\" & Me.CustomerIRN & ".xlsx", False
'DELETING HEADER ROWS - STAGE3
Dim rs As Recordset, done As Boolean, S As String
Set rs = CurrentDb.OpenRecordset("NISFeatureData2")
done = False
While Not rs.EOF And Not done
S = Nz(rs!F1, "")
If S = "Dim" Then done = True
rs.Delete
rs.MoveNext
Wend
rs.Close
'LOOP THRU VALID Dim
Dim FoundEnd As Boolean
Set rs = CurrentDb.OpenRecordset("NISFeatureData2")
FoundEnd = False
While Not rs.EOF
S = Nz(rs!F1, "")
If S = "Comments & Photos:" Then FoundEnd = True
If FoundEnd Then rs.Delete
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
'UPDATE FEATURE DATA - STAGE4
DoCmd.OpenQuery "NISFeatureDataAQ", acViewNormal, acReadOnly
DoCmd.RunCommand acCmdRun
DoCmd.OpenQuery "NISFeatureData1UQ", acViewNormal, acReadOnly
DoCmd.RunCommand acCmdRun
DoCmd.RunMacro "NISNextRecordBack1"
DoCmd.RunMacro "NISFeatureTextRemove1"
DoCmd.RunMacro "NISNextRecordBack1"
'UPDATE COMPONENTS - STAGE5
Dim db As DAO.Database
Set db = CurrentDb()
DoCmd.RunMacro "NISNextRecordBack1"
Wait 1
DoCmd.RunMacro "NISAppComponentNumber1"
Wait 1
Me.CompQty.SetFocus
If Me.CompQty & "" > 0 And Me.CompQty <= DMax("TallyNum", "tblTallyNumbers") Then
Else
MsgBox " Component Qty is required and must be <= the Max value in tblTallyNumbers", vbOKOnly
Me.CompQty.SetFocus
Exit Sub
End If
'UPDATE INSPECTION - STAGE6
DoCmd.RunMacro "NISAppItemComp1"
Wait 1
DoCmd.RunMacro "NextRecordNISComp1"
Wait 1
'HIDE INTEST BUTTON - STAGE7
OrderNumber.SetFocus
InTest.Enabled = False
InTest.Transparent = True
End Sub