How to create a message box to pop up on account number records resulting from a query output (1 Viewer)

Accesslearner1

New member
Local time
Today, 03:36
Joined
Jul 5, 2021
Messages
1
Hi first thread here

wondering if someone can help please? I have created a select query which displays records affected by a problem. On the back of my query I would like a message warning box to appear on the listed records (account number being the field) when searched for via the form when the record has loaded.

thanks
 

Jon

Access World Site Owner
Staff member
Local time
Today, 03:36
Joined
Sep 28, 1999
Messages
7,393
Welcome to the forums! We are the most active Microsoft Access community on the internet by far, with posts going back over 20 years!

To get started, I highly recommend you read the post below. It contains important information for all new users to this forum.

https://www.access-programmers.co.uk/forums/threads/new-member-read-me-first.223250/

We look forward to having you around here, learning stuff and having fun!
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:36
Joined
Oct 29, 2018
Messages
21,471
Hi. Welcome to AWF!

I moved your thread out of the Introduction Forum. You can still introduce yourself in that forum.

As for your question, are you saying you want to use the select query to search for a record?
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:36
Joined
Feb 19, 2002
Messages
43,266
On the back of my query I would like a message warning box to appear on the listed records (account number being the field) when searched for via the form when the record has loaded.
Please try rephrasing this. I can't parse it. Are you saying that you want a message next to each selected row?
 

isladogs

MVP / VIP
Local time
Today, 03:36
Joined
Jan 14, 2017
Messages
18,218
The thread title suggests you want a message box showing the number of records in your select query. Is that correct?
If so, use the DCount function e.g.

Code:
MsgBox "There are " & DCount("*", "YourQueryName") & " records in YourQueryName", vbInformation, "Number of Records"
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 10:36
Joined
May 7, 2009
Messages
19,238
on your search textbox, add code to it's AfterUpdate Event:

private sub txtSearch_AfterUpdate()
dim var as variant
var = DLookup("theFieldToDisplay", "yourQueryName", "AccountNumberField = '" & Nz(Me!txtSearch,"@!@!") & "'")
if not IsNull(var) then
msgbox var
end if
end sub
 

Users who are viewing this thread

Top Bottom