I have a form called tbl-memvid which stores customer number, video number and date. Records are inputted from frmRental. There are five copies of every video and I want a way of indicating whether a copy of a video is available before I save the record to the table. I know it should be embarrassingly simple but any help would be greatly appreciated.
Rob
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Check availability (97/2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Check availability (97/2000)
- This topic has 12 replies, 5 voices, and was last updated 22 years, 6 months ago.
AuthorTopicWSbandido
AskWoody LoungerOctober 16, 2002 at 4:06 pm #378063Viewing 0 reply threadsAuthorReplies-
WSjohnhutchison
AskWoody LoungerOctober 16, 2002 at 9:57 pm #624739 -
WSbandido
AskWoody LoungerOctober 17, 2002 at 3:41 pm #624873Thanks for the response. I have managed to build a query that correctly returns the count of video numbers based on a selected video in a combo box. However, I am having difficulty in displaying this result on an unbound control as you suggested. Would you run through the steps to accomplish this? Also, I don’t know how to use a dlookup on a form. I would be grateful for your help.
Rob -
WSjohnhutchison
AskWoody LoungerOctober 17, 2002 at 9:31 pm #624921OK, lets assume your query is called qryCountsLoans, and that the field it returns is called countofVideoID.
Create an unbound text box. Use the textbox tool from the toolbox. Open the properties box for that control and set its controlsource to be:
= dlookup(“[CountofVideoID]”,”qryCountLoans”)
The structure of a dlookup is “field to return”, “qry or table to look in”, “any criteria”
In your case the query will only have one record so we don’t need any criteria.
If this correctly displays the number of loans, then change the control source to be:
= 5 – dlookup(“[CountofVideoID]”,”qryCountLoans”)
It should display the number available.
There is one extra step. If there are no loans of a particular video, your query probably won’t return zero. Instead it won’t return anything at all ( a null). This needs to be dealt with using the NZ function Null to Zero
= 5 – nz(dlookup(“[CountofVideoID]”,”qryCountLoans”),0) -
WSbandido
AskWoody LoungerOctober 19, 2002 at 11:02 am #625176Thanks for your time. I’ve done as you’ve suggested but an error#, appears in the box. I’ve checked all names used and the syntax but I’ve drawn a blank. What’s so frustrating is that the query, on its own works fine.
The expression I’ve used is: =DLookup(“[CountOfvideo]”,”numavail”).
If you have the time(or the inclination) do you have any suggestions? -
WBell
AskWoody_MVPOctober 19, 2002 at 11:39 am #625183Is numavail the name of your query? If not that could well be your problem. Remember the syntax for DLookup is (“[FieldName]”,”TableOrQueryName”,”Criteria”)
Another approach that we often recommend for this kind of problem is to use a bound form where you could step through amd see all of the info displayed about all videos, and then use an unbound combo box to set a filter to restrict the data being viewed to a specific video. This has some performance benefits compared to using DLookup functions.
-
WSbandido
AskWoody LoungerOctober 19, 2002 at 12:08 pm #625193Thanks for your response. Yes, numavail is the name of the query which displays the accurate value of 3 in the CountOfvideo field when the query is run and the name of the test video is typed into the parameter message box. This is what is driving me mad. The combo box with the drop down list of videos and the text box in which I want to display availability is situated on the same form. Would this create a problem?
-
WSJerry Dennison
AskWoody LoungerOctober 19, 2002 at 6:35 pm #625222I suspect the problem lies in how the query is getting it’s criteria. Try using the table the query is based on and the same criteria you’re using in the query in a DCount() function instead:
=DCount(“[VideoID]”, “VideoTableName”, “[VideoID] = ” & Forms!FormName!VideoID & ” And [Rented] = ” & False) ‘or whatever your criteria needs to be.
-
WBell
AskWoody_MVPOctober 19, 2002 at 7:02 pm #625226We really need a bit more detail to troubleshoot this for you, so let me ask some questions:
- Is your form actually bound to something – perhaps the table? (Being bound means there is an entry in the RecordSource property of the table.)
- If the form is bound, is the query numavail the query the form is bound to?
- What does the syntax of your query look like? (You can switch to the SQL view and post the string – screen captures of the query grid are too large to readily post.)
Your suspicion may be correct, in that the there may be a circular reference involved, but without seeing the details it’s hard to tell.
-
WSpatt
AskWoody LoungerOctober 19, 2002 at 8:55 pm #625230I think Jerry’s suggestion is right on the money.
A problem I think you have is that the query references a control on the form and the dlookup references the query, does this have a problem? Charlotte would know this for sure.
If you can, why don’t you post your DB without any confidential info and see if we can work it out (old Beatles song, boy that dates me !!).
Pat -
WSbandido
AskWoody LoungerOctober 20, 2002 at 12:04 pm #625261Thanks guys for your time and suggestions. At last, I’ve achieved what I set out to do. The query I used in my original DLookup was a [CountOf video number] based on a selected video in combo box. I set up another query (qry_available)which just listed instances of the selected video stored in the member_video table. In the unbound text box I used a DCount function to display the count of videos returned by qry_available. In the Name of Video combo box I requeried qry_available when a selection was made and now it works perfectly. What I don’t understand is that the Dlookup I originally used should have combined the two-stage process (query then count) into one (display CountOfvideo number from qry_numavail). Still, It now does its job. Again, many thanks, all.
Rob -
WSjohnhutchison
AskWoody Lounger -
WSbandido
AskWoody LoungerOctober 21, 2002 at 2:51 pm #625399Thanks John for the sample db. Apparently, my problem was in the query. Essentially, the only difference between yours and mine was that in the videoid column (the second in the QBE grid) you had inserted “Group by” whereas mine did not. I changed my query accordingly and it now works. Very odd.
Still, your help has been much appreciated. Sorry about the naff terminology – I’m still learning.Rob
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Formula to Calculate Q1, Q2, Q3, or Q4 of the Year?
by
WSJon5
33 minutes ago -
Clock missing above calendar in Windows 10 (Awaiting moderation)
by
WSCape Sand
1 hour, 31 minutes ago -
The time has come for AI-generated art
by
Catherine Barrett
7 hours ago -
Hackers are using two-factor authentication to infect you
by
B. Livingston
1 hour, 2 minutes ago -
23 and you
by
Max Stul Oppenheimer
7 hours, 2 minutes ago -
April’s deluge of patches
by
Susan Bradley
5 minutes ago -
April’s deluge of patches
by
Susan Bradley
7 hours, 3 minutes ago -
Windows 11 Windows Updater question
by
Tex265
53 minutes ago -
Key, Key, my kingdom for a Key!
by
RetiredGeek
22 hours, 9 minutes ago -
Registry Patches for Windows 10
by
Drcard:))
1 day, 2 hours ago -
Cannot get line length to NOT wrap in Outlining in Word 365
by
CWBillow
9 hours, 14 minutes ago -
DDU (Display Driver Uninstaller) updates
by
Alex5723
20 hours, 2 minutes ago -
Align objects on a OneNote page
by
CWBillow
1 day, 8 hours ago -
OneNote Send To button?
by
CWBillow
1 day, 8 hours ago -
WU help needed with “Some settings are managed by your organization”
by
Peobody
1 day, 17 hours ago -
No Newsletters since 27 January
by
rog7
1 day, 13 hours ago -
Linux Mint Debian Edition 7 gets OEM support, death of Ubuntu-based Mint ?
by
Alex5723
17 hours, 57 minutes ago -
Windows Update “Areca Technology Corporation – System – 6.20.0.41”
by
Bruce
16 hours, 37 minutes ago -
Google One Storage Questions
by
LHiggins
36 minutes ago -
Button Missing for Automatic Apps Updates
by
pmcjr6142
7 hours, 51 minutes ago -
Ancient SSD thinks it’s new
by
WSila
22 hours, 33 minutes ago -
Washington State lab testing provider exposed health data of 1.6 million people
by
Nibbled To Death By Ducks
2 days, 8 hours ago -
WinRE KB5057589 fake out
by
Susan Bradley
50 minutes ago -
The April 2025 Windows RE update might show as unsuccessful in Windows Update
by
Susan Bradley
1 day, 16 hours ago -
Firefox 137
by
Charlie
18 hours, 57 minutes ago -
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
2 days, 20 hours ago -
Windows 11 Insider Preview build 26120.3863 (24H2) released to BETA
by
joep517
2 days, 20 hours ago -
Windows 11 Insider Preview build 26200.5551 released to DEV
by
joep517
2 days, 20 hours ago -
New Windows 11 PC setup — can I start over in the middle to set up a local id?
by
ctRanger
1 day, 16 hours ago -
Windows 11 Insider Preview Build 26100.3902 (24H2) released to Release Preview
by
joep517
3 days ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.