S
S Marriott
Hi,
I have an annoying problem with Access 2003 using its form_current
procedure. Within the procedure I am calling a function which updates a
listbox (see code below). However, when I open the form it appears to be
continually 'refreshing' the whole form for 5-6 seconds before stopping. I
have tried this on two PCs and the same problem occurs. This should be
really simple, I have tried removing the event and putting a button on the
form to execute the procedure and that works perfectly, however I really do
need it to be on_current!
Any Ideas?
------------------------
Private Sub Form_Current()
Call UpdateObjects
End Sub
Sub UpdateObjects()
Dim strSQL As String
strSQL = "SELECT [Tbl Objects].ObjectID, [Tbl Objects].ProjectID, [Tbl
Objects].ObjectName, "
strSQL = strSQL & "[Tbl Object Types].ObjectType, [Tbl
Objects].ObjectDateCreated, [Tbl Objects].ObjectLastModified "
strSQL = strSQL & "FROM [Tbl Object Types] INNER JOIN [Tbl Objects] ON [Tbl
Object Types].TypeID = [Tbl Objects].Object_Type "
strSQL = strSQL & "WHERE ((([Tbl Objects].ProjectID)=" & Me.ProjectID & ")
AND (([Tbl Object Types].TypeID)=" & Me.CboObjectType.Value & "));"
Me.lstObjects.RowSource = strSQL
Me.Requery
End Sub
----------------------
TIA
Sarah
I have an annoying problem with Access 2003 using its form_current
procedure. Within the procedure I am calling a function which updates a
listbox (see code below). However, when I open the form it appears to be
continually 'refreshing' the whole form for 5-6 seconds before stopping. I
have tried this on two PCs and the same problem occurs. This should be
really simple, I have tried removing the event and putting a button on the
form to execute the procedure and that works perfectly, however I really do
need it to be on_current!
Any Ideas?
------------------------
Private Sub Form_Current()
Call UpdateObjects
End Sub
Sub UpdateObjects()
Dim strSQL As String
strSQL = "SELECT [Tbl Objects].ObjectID, [Tbl Objects].ProjectID, [Tbl
Objects].ObjectName, "
strSQL = strSQL & "[Tbl Object Types].ObjectType, [Tbl
Objects].ObjectDateCreated, [Tbl Objects].ObjectLastModified "
strSQL = strSQL & "FROM [Tbl Object Types] INNER JOIN [Tbl Objects] ON [Tbl
Object Types].TypeID = [Tbl Objects].Object_Type "
strSQL = strSQL & "WHERE ((([Tbl Objects].ProjectID)=" & Me.ProjectID & ")
AND (([Tbl Object Types].TypeID)=" & Me.CboObjectType.Value & "));"
Me.lstObjects.RowSource = strSQL
Me.Requery
End Sub
----------------------
TIA
Sarah