Hi,
I recently split my database and now everything runs really slow. From other posts I can see that this is a common problem.
One of the solution to the slowness that I have found is to have the SQL run on Form Load instead of referencing the query in the Record Source Property.
I can cut and paste the SQL from the query into VBA, but I am afraid that I don't have a lot of coding experience and simply cutting and pasting will not work.
I was hoping that someone could tell me what I am missing...
Private Sub Form_Load()
Me.RecordSource = "qryFormFilter"
SELECT tblPositionDataPRIMARY.PositiontblID, tblPositionDataPRIMARY.PIN, tblPositionDataPRIMARY.ClassCode, tblPositionDataPRIMARY.Pool, tblPositionDataPRIMARY.Stipend, tblPositionDataPRIMARY.[Standard Position], tblPositionDataPRIMARY.ComputerReplacement, Last(tblBioInfoPRIMARY.LastName) AS LastOfLastName
FROM tblBioInfoPRIMARY INNER JOIN (QRYPRIMARYPERMANENTBUDGET INNER JOIN (tblPositionDataPRIMARY INNER JOIN qryFormFilterJobHistory ON tblPositionDataPRIMARY.PositiontblID = qryFormFilterJobHistory.PositionLink) ON QRYPRIMARYPERMANENTBUDGET.PositionLookUp = tblPositionDataPRIMARY.PositiontblID) ON tblBioInfoPRIMARY.EmployeeTableID = qryFormFilterJobHistory.EmployeeLink
GROUP BY tblPositionDataPRIMARY.PositiontblID, tblPositionDataPRIMARY.PIN, tblPositionDataPRIMARY.ClassCode, tblPositionDataPRIMARY.Pool, tblPositionDataPRIMARY.Stipend, tblPositionDataPRIMARY.[Standard Position], tblPositionDataPRIMARY.ComputerReplacement
HAVING (((tblPositionDataPRIMARY.PositiontblID) Like IIf([Forms]![frmRemoteControl]![PIN Choose Box] Is Null,"*",[Forms]![frmRemoteControl]![PIN Choose Box])) AND ((tblPositionDataPRIMARY.ClassCode) Like IIf([Forms]![frmRemoteControl]![Combo47] Is Null,"*",[Forms]![frmRemoteControl]![Combo47])) AND ((tblPositionDataPRIMARY.Pool) Like IIf([Forms]![frmRemoteControl]![cboPositions]=4,-1,"*")) AND ((tblPositionDataPRIMARY.Stipend) Like IIf([Forms]![frmRemoteControl]![cboPositions]=3,-1,"*")) AND ((tblPositionDataPRIMARY.[Standard Position]) Like IIf([Forms]![frmRemoteControl]![cboPositions]=2,-1,"*")))
ORDER BY Last(tblBioInfoPRIMARY.LastName);
Thanks in adavance for any guidance.
R
I recently split my database and now everything runs really slow. From other posts I can see that this is a common problem.
One of the solution to the slowness that I have found is to have the SQL run on Form Load instead of referencing the query in the Record Source Property.
I can cut and paste the SQL from the query into VBA, but I am afraid that I don't have a lot of coding experience and simply cutting and pasting will not work.
I was hoping that someone could tell me what I am missing...
Private Sub Form_Load()
Me.RecordSource = "qryFormFilter"
SELECT tblPositionDataPRIMARY.PositiontblID, tblPositionDataPRIMARY.PIN, tblPositionDataPRIMARY.ClassCode, tblPositionDataPRIMARY.Pool, tblPositionDataPRIMARY.Stipend, tblPositionDataPRIMARY.[Standard Position], tblPositionDataPRIMARY.ComputerReplacement, Last(tblBioInfoPRIMARY.LastName) AS LastOfLastName
FROM tblBioInfoPRIMARY INNER JOIN (QRYPRIMARYPERMANENTBUDGET INNER JOIN (tblPositionDataPRIMARY INNER JOIN qryFormFilterJobHistory ON tblPositionDataPRIMARY.PositiontblID = qryFormFilterJobHistory.PositionLink) ON QRYPRIMARYPERMANENTBUDGET.PositionLookUp = tblPositionDataPRIMARY.PositiontblID) ON tblBioInfoPRIMARY.EmployeeTableID = qryFormFilterJobHistory.EmployeeLink
GROUP BY tblPositionDataPRIMARY.PositiontblID, tblPositionDataPRIMARY.PIN, tblPositionDataPRIMARY.ClassCode, tblPositionDataPRIMARY.Pool, tblPositionDataPRIMARY.Stipend, tblPositionDataPRIMARY.[Standard Position], tblPositionDataPRIMARY.ComputerReplacement
HAVING (((tblPositionDataPRIMARY.PositiontblID) Like IIf([Forms]![frmRemoteControl]![PIN Choose Box] Is Null,"*",[Forms]![frmRemoteControl]![PIN Choose Box])) AND ((tblPositionDataPRIMARY.ClassCode) Like IIf([Forms]![frmRemoteControl]![Combo47] Is Null,"*",[Forms]![frmRemoteControl]![Combo47])) AND ((tblPositionDataPRIMARY.Pool) Like IIf([Forms]![frmRemoteControl]![cboPositions]=4,-1,"*")) AND ((tblPositionDataPRIMARY.Stipend) Like IIf([Forms]![frmRemoteControl]![cboPositions]=3,-1,"*")) AND ((tblPositionDataPRIMARY.[Standard Position]) Like IIf([Forms]![frmRemoteControl]![cboPositions]=2,-1,"*")))
ORDER BY Last(tblBioInfoPRIMARY.LastName);
Thanks in adavance for any guidance.
R