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, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
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
-
Excel Macro — ask for filename to be saved
by
nhsj
6 hours, 51 minutes ago -
Trying to backup Win 10 computer to iCloud
by
SheltieMom
14 hours, 20 minutes ago -
Windows 11 Insider Preview build 26200.5570 released to DEV
by
joep517
1 day, 4 hours ago -
Windows 11 Insider Preview build 26120.3941 (24H2) released to BETA
by
joep517
1 day, 5 hours ago -
Windows 11 Insider Preview Build 22635.5305 (23H2) released to BETA
by
joep517
1 day, 5 hours ago -
No April cumulative update for Win 11 23H2?
by
Peobody
1 day, 8 hours ago -
AugLoop.All (TEST Augmentation Loop MSIT)
by
LarryK
1 day, 6 hours ago -
Boot Sequence for Dell Optiplex 7070 Tower
by
Serge Carniol
1 day, 21 hours ago -
OTT Upgrade Windows 11 to 24H2 on Unsupported Hardware
by
bbearren
2 days, 1 hour ago -
Inetpub can be tricked
by
Susan Bradley
8 hours, 31 minutes ago -
How merge Outlook 2016 .pst file w/into newly created Outlook 2024 install .pst?
by
Tex265
18 hours, 58 minutes ago -
FBI 2024 Internet Crime Report
by
Alex5723
2 days, 4 hours ago -
Perplexity CEO says its browser will track everything users do online
by
Alex5723
1 day, 16 hours ago -
Login issues with Windows Hello
by
CWBillow
2 days, 15 hours ago -
How to get into a manual setup screen in 2024 Outlook classic?
by
Tex265
2 days, 3 hours ago -
Linux : ARMO rootkit “Curing”
by
Alex5723
3 days, 3 hours ago -
Employee monitoring app leaks 21 million screenshots in real time
by
Alex5723
3 days, 3 hours ago -
Google AI is now hallucinating idioms
by
Alex5723
3 days, 4 hours ago -
april update
by
69800
1 day, 8 hours ago -
Windows 11 Insider Preview build 27842 released to Canary
by
joep517
3 days, 5 hours ago -
Quick Fix for Slowing File Explorer
by
Drcard:))
3 days, 5 hours ago -
WuMgr not loading?
by
LHiggins
2 days ago -
Word crashes when accessing Help
by
CWBillow
11 hours, 55 minutes ago -
New Microsoft Nag — Danger! Danger! sign-in to your Microsoft Account
by
EricB
3 days, 4 hours ago -
Blank Inetpub folder
by
Susan Bradley
3 days, 2 hours ago -
Google : Extended Repair Program for Pixel 7a
by
Alex5723
3 days, 15 hours ago -
Updates seem to have broken Microsoft Edge
by
rebop2020
3 days, 1 hour ago -
Wait command?
by
CWBillow
3 days, 8 hours ago -
Malwarebytes 5 Free version manual platform updates
by
Bob99
3 days, 22 hours ago -
inetpub : Microsoft’s patch for CVE-2025–21204 introduces vulnerability
by
Alex5723
4 days, 4 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.