Hi,
I've got a table (tblQuestionnaireComments) which contains fields numbered id_0 to id_50. Within a form (frmCommentReport) there is a text box which generates this number (TxtIDNo) from a list box as the list box only contains 0 to 50. What I can not work out is how to apply a dynamic filter on the table to choose the field needed based on the value of TxtIDNo. This is what I have so far:
When this is run, I get a "Run-time error '424' object required on the ServerFilter.
TxtNodeID is then used to filter out the records needed from [Field].
Ultimately I want to remove all records that do not match the above criteria so help on the filter or the next stage of deleting the unwanted records would be much appreciated.
Many Thanks Gareth
I've got a table (tblQuestionnaireComments) which contains fields numbered id_0 to id_50. Within a form (frmCommentReport) there is a text box which generates this number (TxtIDNo) from a list box as the list box only contains 0 to 50. What I can not work out is how to apply a dynamic filter on the table to choose the field needed based on the value of TxtIDNo. This is what I have so far:
Code:
Field = [Forms]![frmCommentReport]![TxtIDNo]
Node = [Forms]![frmCommentReport]![TxtNodeID]
DoCmd.OpenTable ("tblQuestionnaireComments")
tblQuestionnaireComments.ServerFilter = "[Field] = [Node]"
When this is run, I get a "Run-time error '424' object required on the ServerFilter.
TxtNodeID is then used to filter out the records needed from [Field].
Ultimately I want to remove all records that do not match the above criteria so help on the filter or the next stage of deleting the unwanted records would be much appreciated.
Many Thanks Gareth