dbTalk Databases Forums  

access2007 hourglass while stepping through vba

comp.databases.ms-access comp.databases.ms-access


Discuss access2007 hourglass while stepping through vba in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Roger
 
Posts: n/a

Default access2007 hourglass while stepping through vba - 09-26-2011 , 04:38 PM






access2007, sql2005
form bound to a linked table
combobox bound to a field (baanItem) with an afterUpdate event
the event has a 'stop' statement so I can step through and view
variable contents in the intermediate window

baanItem = ucase(baanitem)
if (nz(itemGroup,"")<>nz(baanItem.column(2),"") then
itemgroup = baanItem.column(2)
end if

stepping through the first line is fine
stepping through the 'if' line, shows an hourglass from a few minutes
once I get control back, with the 'itemgroup =' line highlighted, I
clicked in the 'intermediate window' and again got an hourglass that
lasted minutes

once I get to the window
?itemgroup shows the correct value

but
?baanitem.column(2) brings back the hourglass with a long delay,
but eventually shows the correct value

?baanitem.rowSource is
SELECT trim(t_item), t_dsca, trim(t_citg), trim(t_suno), t_prip,
t_csig FROM qryImcItem WHERE (t_item like 'P10*') ORDER BY t_item

where qryImcItem is a sql server view, and the statement returns
14,000 rows, which I assume is not 'too many'

I tried decompiling, compacting, copying to new mdb - same problem in
all cases

what could be causing this problem ?

Reply With Quote
  #2  
Old   
imb
 
Posts: n/a

Default Re: access2007 hourglass while stepping through vba - 09-28-2011 , 02:22 AM






Quote:
?baanitem.rowSource is
* *SELECT trim(t_item), t_dsca, trim(t_citg), trim(t_suno), t_prip,
t_csig *FROM qryImcItem WHERE (t_item like 'P10*') ORDER BY t_item

Hi Roger,

Functions in a query can slow down the retrieval process.
What happens if you leave out the Trim functions in your query?


Imb.

Reply With Quote
  #3  
Old   
Roger
 
Posts: n/a

Default Re: access2007 hourglass while stepping through vba - 09-28-2011 , 05:53 AM



On Sep 28, 1:22*am, imb <im... (AT) onsmail (DOT) nl> wrote:
Quote:
?baanitem.rowSource is
* *SELECT trim(t_item), t_dsca, trim(t_citg), trim(t_suno), t_prip,
t_csig *FROM qryImcItem WHERE (t_item like 'P10*') ORDER BY t_item

Hi Roger,

Functions in a query can slow down the retrieval process.
What happens if you leave out the Trim functions in your query?

Imb.
I understand that functions slow down a query
but the third party ERP data is created using char() instead of
varchar(), thus the need for the functions

what I don't understand is why the hourglass while I'm stepping
through each line of vba ?
the rowsource is long ago set, and the data has been retrieved from
the sql server ?

Reply With Quote
  #4  
Old   
Roger
 
Posts: n/a

Default Re: access2007 hourglass while stepping through vba - 10-01-2011 , 09:23 AM



On Sep 28, 1:22*am, imb <im... (AT) onsmail (DOT) nl> wrote:
Quote:
?baanitem.rowSource is
* *SELECT trim(t_item), t_dsca, trim(t_citg), trim(t_suno), t_prip,
t_csig *FROM qryImcItem WHERE (t_item like 'P10*') ORDER BY t_item

Hi Roger,

Functions in a query can slow down the retrieval process.
What happens if you leave out the Trim functions in your query?

Imb.
it seems like if I step through the vba, there is no delay
but if I execute the whole function, there is
it's like ms-access needs to release cpu processing to allow data to
be received from sql server (ie doevents)

I'm using linked tables, and odbc datasources - so I'm not sure why
this is an issue

Reply With Quote
  #5  
Old   
Roger
 
Posts: n/a

Default Re: access2007 hourglass while stepping through vba - 10-01-2011 , 02:21 PM



On Oct 1, 8:23*am, Roger <lesperan... (AT) natpro (DOT) com> wrote:
Quote:
On Sep 28, 1:22*am, imb <im... (AT) onsmail (DOT) nl> wrote:

?baanitem.rowSource is
* *SELECT trim(t_item), t_dsca, trim(t_citg), trim(t_suno), t_prip,
t_csig *FROM qryImcItem WHERE (t_item like 'P10*') ORDER BY t_item

Hi Roger,

Functions in a query can slow down the retrieval process.
What happens if you leave out the Trim functions in your query?

Imb.

it seems like if I step through the vba, there is no delay
but if I execute the whole function, there is
it's like ms-access needs to release cpu processing to allow data to
be received from sql server (ie doevents)

I'm using linked tables, and odbc datasources - so I'm not sure why
this is an issue
I've been slowly removing objects from the form until it would work
in it's simplest form, i've got a combobox called baanItem
column count = 6
column widths = 2",2.5",0,0,0,0


the following vba hangs on the second debug.print
baanItem.RowSource = "SELECT * FROM qryImcItem WHERE 1 = 2"
debug.print baanItem.RowSource
Stop
Debug.Print baanItem.Column(3)

qryImcItem is a sql server view,
and the number of rows returned is irrelevant
in this case, I return none

the column width settings allow me to display data other textboxes
using baanItem.column(x)

the first debug.print confirms that the rowsource is correctly set

shouldn't this technique of assigning .columns() as rowsource to
textboxes worked ?

Reply With Quote
  #6  
Old   
Patrick Finucane
 
Posts: n/a

Default Re: access2007 hourglass while stepping through vba - 10-05-2011 , 12:34 PM



On Oct 1, 2:21*pm, Roger <lesperan... (AT) natpro (DOT) com> wrote:
Quote:
On Oct 1, 8:23*am, Roger <lesperan... (AT) natpro (DOT) com> wrote:





On Sep 28, 1:22*am, imb <im... (AT) onsmail (DOT) nl> wrote:

?baanitem.rowSource is
* *SELECT trim(t_item), t_dsca, trim(t_citg), trim(t_suno), t_prip,
t_csig *FROM qryImcItem WHERE (t_item like 'P10*') ORDER BY t_item

Hi Roger,

Functions in a query can slow down the retrieval process.
What happens if you leave out the Trim functions in your query?

Imb.

it seems like if I step through the vba, there is no delay
but if I execute the whole function, there is
it's like ms-access needs to release cpu processing to allow data to
be received from sql server (ie doevents)

I'm using linked tables, and odbc datasources - so I'm not sure why
this is an issue

I've been slowly removing objects from the form until it would work
in it's simplest form, i've got a combobox called baanItem
* column count = 6
* column widths = 2",2.5",0,0,0,0

the following vba hangs on the second debug.print
* baanItem.RowSource = "SELECT * FROM qryImcItem WHERE 1 = 2"
* debug.print baanItem.RowSource
* Stop
* Debug.Print baanItem.Column(3)

qryImcItem is a sql server view,
and the number of rows returned is irrelevant
in this case, I return none

the column width settings allow me to display data other textboxes
using baanItem.column(x)

the first debug.print confirms that the rowsource is correctly set

shouldn't this technique of assigning .columns() as rowsource to
textboxes worked ?- Hide quoted text -

- Show quoted text -
I would offer my sympathy to any user that had to use a form that
contained a selection of 14K rows in a combobox.

Reply With Quote
  #7  
Old   
Roger
 
Posts: n/a

Default Re: access2007 hourglass while stepping through vba - 10-05-2011 , 05:58 PM



On Oct 5, 11:34*am, Patrick Finucane <patrickfinucan... (AT) gmail (DOT) com>
wrote:
Quote:
On Oct 1, 2:21*pm, Roger <lesperan... (AT) natpro (DOT) com> wrote:





On Oct 1, 8:23*am, Roger <lesperan... (AT) natpro (DOT) com> wrote:

On Sep 28, 1:22*am, imb <im... (AT) onsmail (DOT) nl> wrote:

?baanitem.rowSource is
* *SELECT trim(t_item), t_dsca, trim(t_citg), trim(t_suno), t_prip,
t_csig *FROM qryImcItem WHERE (t_item like 'P10*') ORDER BY t_item

Hi Roger,

Functions in a query can slow down the retrieval process.
What happens if you leave out the Trim functions in your query?

Imb.

it seems like if I step through the vba, there is no delay
but if I execute the whole function, there is
it's like ms-access needs to release cpu processing to allow data to
be received from sql server (ie doevents)

I'm using linked tables, and odbc datasources - so I'm not sure why
this is an issue

I've been slowly removing objects from the form until it would work
in it's simplest form, i've got a combobox called baanItem
* column count = 6
* column widths = 2",2.5",0,0,0,0

the following vba hangs on the second debug.print
* baanItem.RowSource = "SELECT * FROM qryImcItem WHERE 1 = 2"
* debug.print baanItem.RowSource
* Stop
* Debug.Print baanItem.Column(3)

qryImcItem is a sql server view,
and the number of rows returned is irrelevant
in this case, I return none

the column width settings allow me to display data other textboxes
using baanItem.column(x)

the first debug.print confirms that the rowsource is correctly set

shouldn't this technique of assigning .columns() as rowsource to
textboxes worked ?- Hide quoted text -

- Show quoted text -

I would offer my sympathy to any user that had to use a form that
contained a selection of 14K rows in a combobox.- Hide quoted text -

- Show quoted text -
I agree, but they want to enter a part# if they know it
and if not, they want to scroll down the list find it

I've added a filtering combo box, to select by product line, but that
still gives me 1000+ rows and performance still sucks

so then I created a local table, and when the product line is
selected, the afterUpdate loads this table with the 1000+ rows, and my
rowsource is based on this local table, and performance is quick

so it takes a couple of seconds to copy 1000 rows from sql server to
the local table with an INSERT
yet when the rowSource is based on the linked table, it takes many
minutes to scroll to the end of the list -
why the difference, in both cases, is it now transferring 1000 rows
once, from the sql server to the access mdb (one, into a table and the
other into a comboBox list) ?

inserting the local table causes bloat, but the architecture is such
that the MDB is reloaded everytime they open the app - so it's not an
issue


but if
I don't want to use a local table, and
I want to allow the user to enter the part # if they know it
I want to allow a lookup if they don't know, and I have no other
filtering options
I want quick performance retrieving sql server data

do I have other options ?

Reply With Quote
  #8  
Old   
ron paii
 
Posts: n/a

Default Re: access2007 hourglass while stepping through vba - 10-07-2011 , 07:13 AM



"Roger" <lesperancer (AT) natpro (DOT) com> wrote

Quote:
On Oct 5, 11:34 am, Patrick Finucane <patrickfinucan... (AT) gmail (DOT) com
wrote:
On Oct 1, 2:21 pm, Roger <lesperan... (AT) natpro (DOT) com> wrote:





On Oct 1, 8:23 am, Roger <lesperan... (AT) natpro (DOT) com> wrote:

On Sep 28, 1:22 am, imb <im... (AT) onsmail (DOT) nl> wrote:

?baanitem.rowSource is
SELECT trim(t_item), t_dsca, trim(t_citg), trim(t_suno),
t_prip,
t_csig FROM qryImcItem WHERE (t_item like 'P10*') ORDER BY
t_item

Hi Roger,

Functions in a query can slow down the retrieval process.
What happens if you leave out the Trim functions in your query?

Imb.

it seems like if I step through the vba, there is no delay
but if I execute the whole function, there is
it's like ms-access needs to release cpu processing to allow data to
be received from sql server (ie doevents)

I'm using linked tables, and odbc datasources - so I'm not sure why
this is an issue

I've been slowly removing objects from the form until it would work
in it's simplest form, i've got a combobox called baanItem
column count = 6
column widths = 2",2.5",0,0,0,0

the following vba hangs on the second debug.print
baanItem.RowSource = "SELECT * FROM qryImcItem WHERE 1 = 2"
debug.print baanItem.RowSource
Stop
Debug.Print baanItem.Column(3)

qryImcItem is a sql server view,
and the number of rows returned is irrelevant
in this case, I return none

the column width settings allow me to display data other textboxes
using baanItem.column(x)

the first debug.print confirms that the rowsource is correctly set

shouldn't this technique of assigning .columns() as rowsource to
textboxes worked ?- Hide quoted text -

- Show quoted text -

I would offer my sympathy to any user that had to use a form that
contained a selection of 14K rows in a combobox.- Hide quoted text -

- Show quoted text -

I agree, but they want to enter a part# if they know it
and if not, they want to scroll down the list find it

I've added a filtering combo box, to select by product line, but that
still gives me 1000+ rows and performance still sucks

so then I created a local table, and when the product line is
selected, the afterUpdate loads this table with the 1000+ rows, and my
rowsource is based on this local table, and performance is quick

so it takes a couple of seconds to copy 1000 rows from sql server to
the local table with an INSERT
yet when the rowSource is based on the linked table, it takes many
minutes to scroll to the end of the list -
why the difference, in both cases, is it now transferring 1000 rows
once, from the sql server to the access mdb (one, into a table and the
other into a comboBox list) ?

inserting the local table causes bloat, but the architecture is such
that the MDB is reloaded everytime they open the app - so it's not an
issue


but if
I don't want to use a local table, and
I want to allow the user to enter the part # if they know it
I want to allow a lookup if they don't know, and I have no other
filtering options
I want quick performance retrieving sql server data

do I have other options ?
For part number lookup, I use a unbound text box, where the user can type-in
the part number for the form to lookup. Other filtering options are vendor,
where used, manufacturer, manufacturer part number, description if indexed.
It they don't know the part number, scrolling a list box will not help. Look
at it from the uses point of view, how do they find part numbers? If your
part's descriptions are structured, try building an index table based on
keywords. Our system has 72000 part numbers and growing, by selecting 2
keywords, BEARING then SC it is filtered down to 7; which can easily be
scrolled.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.