Through the great help by many here the re-write of my database is complete and fully functional.
However I really need to re-address the seriously slow loading of my main form (frm_home) after changing to tab control from navigation control.
This was dealt with briefly in another thread but that thread covered several different subjects and got quite long. I ultimately decided on the solution by pbaldy in this post https://www.access-programmers.co.uk/forums/showpost.php?p=1590961&postcount=108
but the main form takes sometimes more than 60 seconds to load.
Database starts with the login form (frm_loginform) and logging in opens the main form (frm_home).
This is the code for frm_home that deals with the forms on the tabs loading:
I understand this should work but I was wondering if there was another reason.
Two of my forms (frm_labtestinput and frm_visualinspectioninput) have a combobox on them that checks the main table (tbl_auditdata) for the value in the field called "Status".
Let's just deal with one of the forms (frm_visualinspectioninput).
The record source for the form is this query (qry_visinspectinputform)
The query for the combobox is
All looking for the status of "Waiting on Visual Inspection".
in the code for the form (frm_visualinspectioninput) are these blocks of code:
All of this populates the combobox and some of the form fields when the form loads with the first record specified by the query and changes as you change selections in the combobox.
Granted there are two forms that use the same method all be it looking at two different statuses... but just trying to deal with one form and any solution can be ported over to the other one.
Could all of this be contributing tot he slow loading of the main form? Would it help things to have the combobox be blank in the beginning and no forms fields auto filled until a choice was made from the combobox?
However I really need to re-address the seriously slow loading of my main form (frm_home) after changing to tab control from navigation control.
This was dealt with briefly in another thread but that thread covered several different subjects and got quite long. I ultimately decided on the solution by pbaldy in this post https://www.access-programmers.co.uk/forums/showpost.php?p=1590961&postcount=108
but the main form takes sometimes more than 60 seconds to load.
Database starts with the login form (frm_loginform) and logging in opens the main form (frm_home).
This is the code for frm_home that deals with the forms on the tabs loading:
Code:
Option Compare Database
Option Explicit
Public Sub Form_Load()
Dim strMsg As String
Const TabName = "TabCtl87"
Dim pg As Access.Page
Dim tb As Access.TabControl
Set tb = Me.Controls(TabName)
Property Get CurrentPage() As Access.Page
With Me.TabCtl87
Set CurrentPage = .Pages(.Value)
End With
End Property
Private Sub TabCtl87_Change()
Select Case Me.CurrentPage.Name
Case "NewRecordInputForm"
Me.Patrick_Input_Form.SourceObject = "frm_engineerinput"
Case "VisInputForm"
Me.Visual_Inspection_Input_Form.SourceObject = "frm_visualinspectioninput"
Case "LabInputForm"
Me.Lab_Test_Input_Form.SourceObject = "frm_labtestinput"
Case "NewPartForm"
Me.New_Part_Input_Form.SourceObject = "frm_newpartinput"
Case "NewUserForm"
Me.New_User_Input_Form.SourceObject = "frm_newuserinput"
Case "UserProfileForm"
Me.userprofile.SourceObject = "frm_userprofile"
Case "ReportCenterForm"
Me.newreportcenter.SourceObject = "frm_newreportcenter"
End Select
End Sub
I understand this should work but I was wondering if there was another reason.
Two of my forms (frm_labtestinput and frm_visualinspectioninput) have a combobox on them that checks the main table (tbl_auditdata) for the value in the field called "Status".
Let's just deal with one of the forms (frm_visualinspectioninput).
The record source for the form is this query (qry_visinspectinputform)
Code:
SELECT tbl_auditdata.Status, tbl_auditdata.AuditID, tbl_auditdata.Facility, tbl_auditdata.PONumber, tbl_auditdata.PartNumber, tbl_auditdata.TotalReceived, tbl_auditdata.VisInspectDate, tbl_auditdata.PartProdDate, tbl_auditdata.QCLine, tbl_auditdata.BlackGreenDot, tbl_auditdata.TotalVisInspected, tbl_auditdata.TotalVisBad, tbl_auditdata.TotalVisGood, tbl_auditdata.VisDefectFound, tbl_auditdata.VisAtt, tbl_auditdata.VisualInspectorUserID, tbl_auditdata.LabInspectorUserID, tbl_auditdata.VisUpdate, tbl_auditdata.RecDate, tbl_auditdata.MfgPONum
FROM tbl_auditdata
WHERE (((tbl_auditdata.Status)="Waiting on Visual Inspection"));
The query for the combobox is
Code:
SELECT tbl_auditdata.AuditID, tbl_auditdata.PONumber, tbl_auditdata.Status, [tbl_parts].[PartNumber] & " - " & [tbl_parts].[PartDesc] AS Expr1
FROM tbl_auditdata INNER JOIN tbl_parts ON tbl_auditdata.PartNumber = tbl_parts.ID
WHERE (((tbl_auditdata.Status)="Waiting on Visual Inspection"))
ORDER BY tbl_auditdata.PONumber;
in the code for the form (frm_visualinspectioninput) are these blocks of code:
Code:
Private Sub cboGoToRecord_AfterUpdate()
On Error Resume Next
Dim rst As Object
Set rst = Me.RecordsetClone
rst.FindFirst "AuditID = " & Me.cboGoToRecord.Value
Me.Bookmark = rst.Bookmark
End Sub
Private Sub Form_Current()
Me.cboGoToRecord.Value = Me.AuditID.Value
End Sub
All of this populates the combobox and some of the form fields when the form loads with the first record specified by the query and changes as you change selections in the combobox.
Granted there are two forms that use the same method all be it looking at two different statuses... but just trying to deal with one form and any solution can be ported over to the other one.
Could all of this be contributing tot he slow loading of the main form? Would it help things to have the combobox be blank in the beginning and no forms fields auto filled until a choice was made from the combobox?