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

Accesslearner1

New member
Local time
Today, 06:31
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
 
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!
 
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?
 
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?
 
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"
 
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

Back
Top Bottom