Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Posts
    37

    Unanswered: combo box query in sub form

    Hi I have a query using a combox as the control source I have this working no problem on a form.

    Problem is when I try to call this as a subform nothing happens

    Code in the query
    Code:
    [Forms]![frmMain]![combo59]

    Code in a single form

    Code:
    Private Sub Combo59_Change()
     DoCmd.OpenForm "testcombo"
        Me.Combo59 = ""
    End Sub
    Code for the main form

    Code:
    Private Sub Combo59_Change()
        Call OpenMySubForm(Me.testcombo) 
        Me.Combo59 = ""
    End Sub

    Is this anything to do with the fact that the subform is allready open when the main form is opened ?

    JD

  2. #2
    Join Date
    Dec 2003
    Posts
    37
    After several tests I now have this and a text box search working

    But not wanting to make my life easy I was wondering where would you place an if statement to prompt the user with a msgbox if the query returns no results, instead of an empty form.

    JD

  3. #3
    Join Date
    Feb 2004
    Location
    Wales
    Posts
    343
    hi

    Im assumimg that the sub form combo is collecting that data and placing it on the main form?

    if this is the case you can put a small iff in to one of the text boxes that will react to a null

    gareth

  4. #4
    Join Date
    Dec 2003
    Posts
    37
    Hi Gareth the combo box is on the main form and it refreshes and sets a subform to visible.

    JD

  5. #5
    Join Date
    Feb 2004
    Location
    Wales
    Posts
    343
    in the subform it would be advisable to have a capture for the NULL record data.

    when there combo is set to make visable you can use the iff to say iffisnot null, vis subform,goto combo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •