Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Guest ji, please consider donating today!   Become a Supporter    ::   Make a Contribution   
    Monthly (Recurring) Target: $300 :: Achieved: $95

Help opening up query into form

Discussion in 'Information Technology' started by mwest, Jul 28, 2006.

  1. mwest

    mwest
    Expand Collapse
    Guest

    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.

    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
     
  2. Loading...


  3. strive4peace

    strive4peace
    Expand Collapse
    Guest

    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
    "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.
    >
    > 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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page