I have a form that gets its data from a query, sometimes the query will produce no records, and the form opens up blank, ideally I would like the form not to open if there are no records and a message box open telling the user to input different valuves into the criteria for the query.
Create an "Open" even procedure for the form that you're talking about.
Within that code do something like this:
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Dim cnt As Integer
Set con = Application.CurrentProject.Connection
set rs = con.Execute "SELECT Count(*) as num_rows FROM your_query_name"
cnt = rs.Fields("num_rows").Value
Set rs = nothing
set con = nothing
If cnt = 0 Then
MsgBox "Form will be closed"
DoCmd.Close acForm, "your_form_name", acSaveNo