Results 1 to 2 of 2
  1. #1
    lgreco
    Guest

    Using combo box as query parameter

    Using Access 97
    I'm trying to create a form which in essence, has a buttonand a combo box on it. When a selection is made from the combo box, the button is clicked and a record is displayed on a data entry form.

    The combo box contains first and last names and the form contains all other fields describing a person; address phone ...

    My problem is that even though I use forms!frmAdmin!cboPatients as the paramater in the query, my form doesn't display the selected record.

    the onclick event has these lines in it.

    doCmd.OpenForm "frmName", acNormal
    forms!frmName.recordSource = qryNames

    This is pretty basic, but I still can't get it to work.

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using combo box as query parameter

    2 things to check:
    1) Even though the combo box shows a certain value, it's possible that the actual value is coming from a different column in the RowSource, even a hidden column. Check into the RowSource property of the combo box.

    2) This may or may not be a valid issue, but double check the line you used to set the RecordSource property of the form. It should probably read:<pre>Form_frmName.RecordSource = qryNames</pre>

    HTH <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

Posting Permissions

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