If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Message box question
Is there a way that I can display a message using msgbox that after a
field is populated, the records are searched for the same entry and give a count. Something like: msgbox "There are " (insert count here) "records that have the same information." Thanks James |
#2
|
|||
|
|||
Message box question
"hotplate" wrote in message
... Is there a way that I can display a message using msgbox that after a field is populated, the records are searched for the same entry and give a count. Something like: msgbox "There are " (insert count here) "records that have the same information." Thanks James You'd probably use the control's AfterUpdate event, and use DCount to find out how many matching records there are. Something like: '------ start of example code ------ Private Sub YourControlName_AfterUpdate() Dim lngCount As Long lngCount = _ DCount("*", "YourTableName", _ "YourFieldName=[Forms]![YourFormName]![YourControlName]") MsgBox _ "There are " & lngCount & "records that have the same information." End Sub '------ end of example code ------ -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|