hi there. I have a split database that's running on a network. it's running soooo slowly. I've tried improving my code wherever I could.. but it's still really slow.
i think the part that's killing me is in my before update method, i'm checking every control and see if it's been assigned a value. if not, depending on the control, i assign a default value of 101 or something else.
There are about 80 different text boxes that i'm checking.
The code looks like:
Private Sub Section1CheckForMissingValues()
If IsNull(Me.ABC.Value) Then
Me.ABC.Value = 101
End If
If IsNull(Me.ZZZ.Value) Then
Me.ZZZ.Value = 101
End If
If IsNull(Me.BBB.Value) Then
Me.BBB.Value = 101
End If
etc...
And the way that I call it is as follows:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Call Section1CheckForMissingValues
Call Section2CheckForMissingValues
Call Section3CheckForMissingValues
Call Section4CheckForMissingValues
Call basLogTrans(Me, "RecruitmentID", RecruitmentID)
End Sub
I guess I could set the default value at the table level to 101 for most of my controls... instead of looping through each one at the end. But I just want to make sure that its really this piece of code that is slowing everything down. I know that 80 seems like a big number ... but the code is so simple, it really should zip through it, shouldn't it? I'm not an ms access expert so I dunno..
Any suggestions would be appreciated.
i think the part that's killing me is in my before update method, i'm checking every control and see if it's been assigned a value. if not, depending on the control, i assign a default value of 101 or something else.
There are about 80 different text boxes that i'm checking.
The code looks like:
Private Sub Section1CheckForMissingValues()
If IsNull(Me.ABC.Value) Then
Me.ABC.Value = 101
End If
If IsNull(Me.ZZZ.Value) Then
Me.ZZZ.Value = 101
End If
If IsNull(Me.BBB.Value) Then
Me.BBB.Value = 101
End If
etc...
And the way that I call it is as follows:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Call Section1CheckForMissingValues
Call Section2CheckForMissingValues
Call Section3CheckForMissingValues
Call Section4CheckForMissingValues
Call basLogTrans(Me, "RecruitmentID", RecruitmentID)
End Sub
I guess I could set the default value at the table level to 101 for most of my controls... instead of looping through each one at the end. But I just want to make sure that its really this piece of code that is slowing everything down. I know that 80 seems like a big number ... but the code is so simple, it really should zip through it, shouldn't it? I'm not an ms access expert so I dunno..
Any suggestions would be appreciated.