PDA

View Full Version : Filtering A Specific Record From A Form



mattster1010
06-09-2010, 02:46 AM
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:

DoCmd.OpenForm "Surveys", , , "CustomerID = " & Me.CustomerID_List & ""
DoCmd.Close acForm, "menu", acSaveNo

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

Imdabaum
06-09-2010, 10:51 AM
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.

Imdabaum
06-09-2010, 12:41 PM
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:

'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
....


Just hides that freeform box if they change their mind.

Very cool application. The tabs behave a little quarky for me too.