Instead of putting the criteria in your query, try using the
WHERECLAUSE parameter of the Openform action
DoCmd.OpenForm formname[, view][, filtername][,
wherecondition][, datamode][, windowmode][, openargs]
for help on OpenForm, press the F1 key on the word
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13406
"OpenForm" in your code or in the Immediate window
you also should replace the commas with underscores in your
formname. It is a good idea to only use letters, numbers
(but never as the first character), and underscores in
tablenames, fieldnames, fornmames, etc -- and avoid using spaces
Warm Regards,
Crystal
Microsoft Access MVP 2006
*
Have an awesome day
remote programming and training
strive4peace2006 at yahoo.com
*
mwest wrote:
> I have a query called retreived selected contaminant,department,date and the
> code below however when I enter the information below it gives me a blank
> form instead of the information I requested.
>
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13406
> Private Sub MultiOK_Click()
> On Error GoTo b
> If IsNull(Me.Combo0) Or IsNull(Me.Combo2) Then
> MsgBox "Please include all criteria for the report.", vbInformation, "Some
> nifty title here."
> Me.Combo0.SetFocus
> GoTo a
> End If
> Me.Visible = False
> DoCmd.OpenForm "contaminant,department,date Display"
> DoCmd.Close acForm, Me.Name
> DoCmd.SelectObject acForm, "contaminant,department,date Display"
> a: Exit Sub
> b: MsgBox Err.Number & " " & Err.Description
> Resume a
> End Sub