Hello all,
I am trying to create a pop up window with information from a query when i click a button on my main screen. How do i tell it to use the contents of the query as information passed to the msg box?
A little history about this task i had created a query based on information from a table i have. For the Criteria i used IIf([Dig_Permit_Terminated]<=Date()-5,Null). Hard to test unless i have records to show in that query I know. what i would like for information in the Msg Box are as follows: Field Name : Dig_Permit_Number & Project_Number & UNCC_Number & Dig_Permit_Terminated. if there not any that match the criteria then a simple "Nothing is due at this time."
Is it as simple as that or i have to connect to that table correct to pull that information from so far i have gotten to here:
Code:
Private Sub Form_Load()DoCmd.OpenQuery "MsgBox_Dig_Permits"
Dim ID As Long
ID = Nz(DLookup("[Dig_Permit_Terminated]", "Dig_Permits", "Dig_Permit_Terminated=<#" & Date - 5 & "#"), 0)
If ID <> 0 Then
DoCmd.OpenForm "msgbox_frm"
Else
MsgBox " Currently No Dig Permits need Renewed", vbOKOnly