unbound textbox errors when depending textbox encounters delay

smile

Registered User.
Local time
Today, 10:30
Joined
Apr 21, 2006
Messages
212
Hi, I have a problem that on some reports and forms I have placed unbound textbox1 that has formula and does some calculations.

The textbox pulls information from a query and makes it available on report or form.

The problem I have is with second unbound textbox2 that takes result from textbox1 and applies module function to it. If there is some delay while first textbox shows result the second fails with error or with VBA debug popup because my VBA code got a string that is empty.

The problem is more obvious if first textbox uses dlookup function (is it the only one to display result on form or report from query?).

-------------------------------------------------

So for example I use module that converts numbers to words (for invoice). I have created a total query that calculates amount for certain invoice and then I use second query that takes this result and convert it to words.

I then include those queries in my report recordset and place them using design view.

I mean the module that convert numbers to words or any other never fails it it gets data from and is calculated by query.
--------------------------------------------------
1.So I'm confused should I create separate number to words queries and include them on form or report recordset.

2. Should I place unbound textbox place conversion code there with reference to a bound textbox field to get data from.

I save 1 query in every case I use scenario 2. when I make a report so that’s 6 queries less for my db. (I have 30qry's so far). Is it worth the redesign in effort to make it run faster and be more compact?

Your comments are appreciated.
 
Hi Smile,
Is it that there is a delay or are you getting a null value in the first textbox?

Q
 
Hi Smile,
Is it that there is a delay or are you getting a null value in the first textbox?

Q

Well I get script debug window don't remember the exact error.

I did redesign my db to make everything bound and not use any unbount textboxes at least not calculation textboxes that depend on another not bound control.

I however would like to ask the same qustion again:

1.So I'm confused should I create separate number to words queries and include them on form or report recordset.

2. Should I place unbound textbox place conversion code there with reference to a bound textbox field to get data from.

I save 1 query in every case I use scenario 2. when I make a report so that’s 6 queries less for my db. (I have 30qry's so far). Is it worth the redesign in effort to make it run faster and be more compact?

How does access process queries? If it caches data from 1st query in the cascade then second query only works with the data in memory ot something like that that means it's good idea to calculate everything in separate query.

Otherwise if access does not cache the data and perhaps works like this:
1st cascade query pulls data by criteria
2nd query depends on 1st query so 1st query is executed again ?
3rd query depends on 2nd and 1st so those a ran once again ?
 

Users who are viewing this thread

Back
Top Bottom