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, 8 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
-
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
28 minutes ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
1 hour, 48 minutes ago -
Tools to support internet discussions
by
Kathy Stevens
8 hours, 38 minutes ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
6 hours, 59 minutes ago -
AI is good sometimes
by
Susan Bradley
9 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
14 hours, 19 minutes ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
1 day, 9 hours ago -
June KB5060842 update broke DHCP server service
by
Alex5723
1 day, 7 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
1 day, 11 hours ago -
Excessive security alerts
by
WSSebastian42
2 hours, 40 minutes ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
1 day, 21 hours ago -
Ben’s excellent adventure with Linux
by
Ben Myers
1 hour, 35 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
1 day, 8 hours ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
2 hours, 7 minutes ago -
OS news from WWDC 2025
by
Will Fastie
12 hours, 25 minutes ago -
Need help with graphics…
by
WSBatBytes
16 hours, 39 minutes ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
2 days, 12 hours ago -
Totally remove or disable BitLocker
by
CWBillow
1 day, 11 hours ago -
Windows 10 gets 6 years of ESU?
by
n0ads
1 day, 15 hours ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
2 days, 23 hours ago -
Search Forums only bring up my posts?
by
Deo
8 hours, 13 minutes ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
3 days, 11 hours ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
3 days, 3 hours ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
3 days, 11 hours ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
3 days, 22 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
3 days, 23 hours ago -
Disengage Bitlocker
by
CWBillow
3 days, 13 hours ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
4 days, 1 hour ago -
New Win 11 Pro Geekom Setup questions
by
Deo
8 hours, 2 minutes ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
4 days, 8 hours 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.