DCount Records to Display in Form

B

Boomer

I have an unbound text box in a form (frm_AssetsUnderMan) based on a table
(tbl_Assets) that shows the count of any type of asset obtained from a query.

=DCount("Asset","AssetListFilter")

AssetListFilter is the query.

In my main form the DCount function works but the result is only displayed
when I click in control for the count or when I minimise and then restore the
form window. If I don't have that control selected when I move to the next
record then the number disappears until I select the control again.

The control appears to be attempting to refresh as it very briefly flashes
every now and again but the number does not appear unless it is selected. How
can I have the number automatically appear everytime the form is opened and
another record is selected?

It maybe related. When first opening the form the Record navigation at the
bottom just shows 1 and moving forward only shows the single digit count. I
have to click the Last Record control to show the number of number e.g. 3115
of 3115 and then back to first record to get 1 of 3115. After that the record
navigation displays as usual until I close and then reopen the form.
 
G

Gina Whipp

Boomer,

Not sure about a query named AssetListFilter, what is it filtering? You
also didn't say what results you expected to get. Try...

=DCount("Asset","tbl_Assets")

....and see if that gives you what you want.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
B

Boomer

I'm filtering by Assets. E.g.

Widget
Wodget
Wadget

Say we have 100 Widgets under management. We track each by model, serial,
part number, type and a bunch of other data.

We might also have 60 Wodgets and 90 Wadgets.

What I needed on the form was a box that automatically counted and displayed
the total number of each type of asset as the user scrolled through the
records. I also had a query that pops up a datasheet with data for just one
type of asset, and it was that I based the control box on.

As I said the actual count worked fine, it just didn't display in the
control until the control was selected.

I have solved this problem by doing the DCount on the table instead of the
query:

=DCount("*","tbl_Assets","[Asset]='" & [Asset] & "'")

I don't know why it won't display correctly using the query, but that's the
mysterious world of Access I guess.
 
G

Gina Whipp

Boomer,

Without seeing the SQL to your query I'm going to say I don't know either
because I do use DCount the way you are using it with no problems.

Glad you figured it out...
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Boomer said:
I'm filtering by Assets. E.g.

Widget
Wodget
Wadget

Say we have 100 Widgets under management. We track each by model, serial,
part number, type and a bunch of other data.

We might also have 60 Wodgets and 90 Wadgets.

What I needed on the form was a box that automatically counted and
displayed
the total number of each type of asset as the user scrolled through the
records. I also had a query that pops up a datasheet with data for just
one
type of asset, and it was that I based the control box on.

As I said the actual count worked fine, it just didn't display in the
control until the control was selected.

I have solved this problem by doing the DCount on the table instead of the
query:

=DCount("*","tbl_Assets","[Asset]='" & [Asset] & "'")

I don't know why it won't display correctly using the query, but that's
the
mysterious world of Access I guess.


Gina Whipp said:
Boomer,

Not sure about a query named AssetListFilter, what is it filtering? You
also didn't say what results you expected to get. Try...

=DCount("Asset","tbl_Assets")

....and see if that gives you what you want.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
B

Boomer

OK now I'm really miffed.

=DCount("*","tbl_Assets","[Asset]='" & [Asset] & "'")

That code was working perfectly. I had saved the form and did nothing else
but close Access for the day.

I come in this morning to start work, open the database and get the Name?
error in the control box for that code. What would have made it stop working
after it had been doing exactly what it was supposed to?
 
G

Gina Whipp

Boomer,

Check References... http://www.regina-whipp.com/index_files/References.htm

If that doesn't work, what version of Access?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Boomer said:
OK now I'm really miffed.

=DCount("*","tbl_Assets","[Asset]='" & [Asset] & "'")

That code was working perfectly. I had saved the form and did nothing else
but close Access for the day.

I come in this morning to start work, open the database and get the Name?
error in the control box for that code. What would have made it stop
working
after it had been doing exactly what it was supposed to?



Boomer said:
I have an unbound text box in a form (frm_AssetsUnderMan) based on a
table
(tbl_Assets) that shows the count of any type of asset obtained from a
query.

=DCount("Asset","AssetListFilter")

AssetListFilter is the query.

In my main form the DCount function works but the result is only
displayed
when I click in control for the count or when I minimise and then restore
the
form window. If I don't have that control selected when I move to the
next
record then the number disappears until I select the control again.

The control appears to be attempting to refresh as it very briefly
flashes
every now and again but the number does not appear unless it is selected.
How
can I have the number automatically appear everytime the form is opened
and
another record is selected?

It maybe related. When first opening the form the Record navigation at
the
bottom just shows 1 and moving forward only shows the single digit count.
I
have to click the Last Record control to show the number of number e.g.
3115
of 3115 and then back to first record to get 1 of 3115. After that the
record
navigation displays as usual until I close and then reopen the form.
 
B

Boomer

Thanks for you patience Gina.

Access 2007 and you are not going to believe this. Frustrated I worked on
making some cosmetic changes to a completely unrelated form and then a short
while ago I came back to the Assets Under Mangagement form
(frm_AssetsUnderMan) and bingo everything is working fine as though nothing
had happened.

Prior to this I also had a simple query that has been working faultlessly
for many weeks fail. That is also all of a sudden working again.

Seems there was a glitch somewhere and as long as it stays away I'm happy.

Gina Whipp said:
Boomer,

Check References... http://www.regina-whipp.com/index_files/References.htm

If that doesn't work, what version of Access?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Boomer said:
OK now I'm really miffed.

=DCount("*","tbl_Assets","[Asset]='" & [Asset] & "'")

That code was working perfectly. I had saved the form and did nothing else
but close Access for the day.

I come in this morning to start work, open the database and get the Name?
error in the control box for that code. What would have made it stop
working
after it had been doing exactly what it was supposed to?



Boomer said:
I have an unbound text box in a form (frm_AssetsUnderMan) based on a
table
(tbl_Assets) that shows the count of any type of asset obtained from a
query.

=DCount("Asset","AssetListFilter")

AssetListFilter is the query.

In my main form the DCount function works but the result is only
displayed
when I click in control for the count or when I minimise and then restore
the
form window. If I don't have that control selected when I move to the
next
record then the number disappears until I select the control again.

The control appears to be attempting to refresh as it very briefly
flashes
every now and again but the number does not appear unless it is selected.
How
can I have the number automatically appear everytime the form is opened
and
another record is selected?

It maybe related. When first opening the form the Record navigation at
the
bottom just shows 1 and moving forward only shows the single digit count.
I
have to click the Last Record control to show the number of number e.g.
3115
of 3115 and then back to first record to get 1 of 3115. After that the
record
navigation displays as usual until I close and then reopen the form.
 
G

Gina Whipp

Boomer,

Well, glad to hear but wondering why it's happening at all... Your
database is in a Trusted Location and you have turned off Auto-name Correct,
correct?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Boomer said:
Thanks for you patience Gina.

Access 2007 and you are not going to believe this. Frustrated I worked on
making some cosmetic changes to a completely unrelated form and then a
short
while ago I came back to the Assets Under Mangagement form
(frm_AssetsUnderMan) and bingo everything is working fine as though
nothing
had happened.

Prior to this I also had a simple query that has been working faultlessly
for many weeks fail. That is also all of a sudden working again.

Seems there was a glitch somewhere and as long as it stays away I'm happy.

Gina Whipp said:
Boomer,

Check References...
http://www.regina-whipp.com/index_files/References.htm

If that doesn't work, what version of Access?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Boomer said:
OK now I'm really miffed.

=DCount("*","tbl_Assets","[Asset]='" & [Asset] & "'")

That code was working perfectly. I had saved the form and did nothing
else
but close Access for the day.

I come in this morning to start work, open the database and get the
Name?
error in the control box for that code. What would have made it stop
working
after it had been doing exactly what it was supposed to?



:

I have an unbound text box in a form (frm_AssetsUnderMan) based on a
table
(tbl_Assets) that shows the count of any type of asset obtained from a
query.

=DCount("Asset","AssetListFilter")

AssetListFilter is the query.

In my main form the DCount function works but the result is only
displayed
when I click in control for the count or when I minimise and then
restore
the
form window. If I don't have that control selected when I move to the
next
record then the number disappears until I select the control again.

The control appears to be attempting to refresh as it very briefly
flashes
every now and again but the number does not appear unless it is
selected.
How
can I have the number automatically appear everytime the form is
opened
and
another record is selected?

It maybe related. When first opening the form the Record navigation at
the
bottom just shows 1 and moving forward only shows the single digit
count.
I
have to click the Last Record control to show the number of number
e.g.
3115
of 3115 and then back to first record to get 1 of 3115. After that the
record
navigation displays as usual until I close and then reopen the form.
 
B

Boomer

Yes.

I'm the only person who has access to the database at the moment and
Auto-name Correct is off.

Looks like the form got hung up on something for a short while and wasn't
updating some parts. We are having server issues which our IT people are
looking at this afternoon, might or might not be related. I'm just glad it's
working again.

Thanks

Gina Whipp said:
Boomer,

Well, glad to hear but wondering why it's happening at all... Your
database is in a Trusted Location and you have turned off Auto-name Correct,
correct?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Boomer said:
Thanks for you patience Gina.

Access 2007 and you are not going to believe this. Frustrated I worked on
making some cosmetic changes to a completely unrelated form and then a
short
while ago I came back to the Assets Under Mangagement form
(frm_AssetsUnderMan) and bingo everything is working fine as though
nothing
had happened.

Prior to this I also had a simple query that has been working faultlessly
for many weeks fail. That is also all of a sudden working again.

Seems there was a glitch somewhere and as long as it stays away I'm happy.

Gina Whipp said:
Boomer,

Check References...
http://www.regina-whipp.com/index_files/References.htm

If that doesn't work, what version of Access?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

OK now I'm really miffed.

=DCount("*","tbl_Assets","[Asset]='" & [Asset] & "'")

That code was working perfectly. I had saved the form and did nothing
else
but close Access for the day.

I come in this morning to start work, open the database and get the
Name?
error in the control box for that code. What would have made it stop
working
after it had been doing exactly what it was supposed to?



:

I have an unbound text box in a form (frm_AssetsUnderMan) based on a
table
(tbl_Assets) that shows the count of any type of asset obtained from a
query.

=DCount("Asset","AssetListFilter")

AssetListFilter is the query.

In my main form the DCount function works but the result is only
displayed
when I click in control for the count or when I minimise and then
restore
the
form window. If I don't have that control selected when I move to the
next
record then the number disappears until I select the control again.

The control appears to be attempting to refresh as it very briefly
flashes
every now and again but the number does not appear unless it is
selected.
How
can I have the number automatically appear everytime the form is
opened
and
another record is selected?

It maybe related. When first opening the form the Record navigation at
the
bottom just shows 1 and moving forward only shows the single digit
count.
I
have to click the Last Record control to show the number of number
e.g.
3115
of 3115 and then back to first record to get 1 of 3115. After that the
record
navigation displays as usual until I close and then reopen the form.
 
G

Gina Whipp

Boomer,

MAKE A BACK UP... Just in case you didn't get the MAKE A BACK UP!!
Databases on Server with issues = the Server wins the Database crashes,
sometimes for good. And yes, that could very well be the issue, so MAKE A
BACK UP... Hopefully, the next time we see you back here it won't be
looking for recovery services!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Boomer said:
Yes.

I'm the only person who has access to the database at the moment and
Auto-name Correct is off.

Looks like the form got hung up on something for a short while and wasn't
updating some parts. We are having server issues which our IT people are
looking at this afternoon, might or might not be related. I'm just glad
it's
working again.

Thanks

Gina Whipp said:
Boomer,

Well, glad to hear but wondering why it's happening at all... Your
database is in a Trusted Location and you have turned off Auto-name
Correct,
correct?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Boomer said:
Thanks for you patience Gina.

Access 2007 and you are not going to believe this. Frustrated I worked
on
making some cosmetic changes to a completely unrelated form and then a
short
while ago I came back to the Assets Under Mangagement form
(frm_AssetsUnderMan) and bingo everything is working fine as though
nothing
had happened.

Prior to this I also had a simple query that has been working
faultlessly
for many weeks fail. That is also all of a sudden working again.

Seems there was a glitch somewhere and as long as it stays away I'm
happy.

:

Boomer,

Check References...
http://www.regina-whipp.com/index_files/References.htm

If that doesn't work, what version of Access?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

OK now I'm really miffed.

=DCount("*","tbl_Assets","[Asset]='" & [Asset] & "'")

That code was working perfectly. I had saved the form and did
nothing
else
but close Access for the day.

I come in this morning to start work, open the database and get the
Name?
error in the control box for that code. What would have made it stop
working
after it had been doing exactly what it was supposed to?



:

I have an unbound text box in a form (frm_AssetsUnderMan) based on
a
table
(tbl_Assets) that shows the count of any type of asset obtained
from a
query.

=DCount("Asset","AssetListFilter")

AssetListFilter is the query.

In my main form the DCount function works but the result is only
displayed
when I click in control for the count or when I minimise and then
restore
the
form window. If I don't have that control selected when I move to
the
next
record then the number disappears until I select the control again.

The control appears to be attempting to refresh as it very briefly
flashes
every now and again but the number does not appear unless it is
selected.
How
can I have the number automatically appear everytime the form is
opened
and
another record is selected?

It maybe related. When first opening the form the Record navigation
at
the
bottom just shows 1 and moving forward only shows the single digit
count.
I
have to click the Last Record control to show the number of number
e.g.
3115
of 3115 and then back to first record to get 1 of 3115. After that
the
record
navigation displays as usual until I close and then reopen the
form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top