Consulting

Results 1 to 3 of 3

Thread: Filtering A Specific Record From A Form

  1. #1

    Filtering A Specific Record From A Form

    Morning All,

    I have attached the database that I am currently working on. I am trying to use a form that displays all 'outstanding' surveys and use a command button that opens another form diplaying the details of the specific record.

    The code I am using to do this is as follows:

    [vba]DoCmd.OpenForm "Surveys", , , "CustomerID = " & Me.CustomerID_List & ""
    DoCmd.Close acForm, "menu", acSaveNo[/vba]

    I have a feeling that this isn't working due to the subform's on the 'Survey' form that open's displaying the specific record.

    Can anyone advise if the above code I'm using needs to be amended or if this isn't the right way to open the record.

    The database table's will need to be re-linked to CSS_BE.mdb before opening.

    Regards,

    Matt

  2. #2
    VBAX Expert Imdabaum's Avatar
    Joined
    Jun 2006
    Posts
    652
    Location
    I think it has something more to do with the fact that CustomerID doesn't exist on the form you're trying to open.

    Add SurveyID to your query and change CustomerID to SurveyID.
    Someday I'll understand everything...
    Even then...I'll still pretend I'm a beginner.

  3. #3
    VBAX Expert Imdabaum's Avatar
    Joined
    Jun 2006
    Posts
    652
    Location
    Not sure if you are finished with this if not feel free to ignore this. For the sub that handles the Answer drop down, I'd suggest adding the code:
    [VBA]
    'Form_Customer Responses
    Private Sub List10_AfterUpdate()
    If Me.Question_Responses = "Manual Answer" Then
    Me.Free_Text_Answer.Visible = True
    Me.Label17.Visible = True
    Else
    Me.Free_Text_Answer.Visible = False
    Me.Label17.Visible = False
    End If
    ....
    [/VBA]

    Just hides that freeform box if they change their mind.

    Very cool application. The tabs behave a little quarky for me too.
    Someday I'll understand everything...
    Even then...I'll still pretend I'm a beginner.

Posting Permissions

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