Hi guys,
Im trying to create a web form that displays my records and can be filtered based on criteria that the user enters.
I decided to create a main form (frmMain) and house a subform within it which displays all records in the datasheet view (frmSub). The control box for this subform is called "subDatasheet".
In the heading of the main form I created a combobox for selecting a field to filter by (cboField), a textbox to enter the criteria (txtCriteria) and a button to apply the filter (btnFilter).
I am using the OnClick event of the button to trigger the filter:
SetTempVar(Field, =[cboField])
SetTempVar(Criteria, =[txtCriteria])
SetFilter(=[TempVars]![Field] Like [TempVars]![Criteria], subDatasheet)
When I manually entered the criteria as a string the filter works fine, but with these tempvars the subform filters everything and returns 0 records.
I am not sure if I am passing the TempVars correctly or not, this is my first time working with Access Web Forms.
I will post a picture of my form so that you can get a better understanding of what I am trying to accomplish.
Thanks in advance for any help!
Im trying to create a web form that displays my records and can be filtered based on criteria that the user enters.
I decided to create a main form (frmMain) and house a subform within it which displays all records in the datasheet view (frmSub). The control box for this subform is called "subDatasheet".
In the heading of the main form I created a combobox for selecting a field to filter by (cboField), a textbox to enter the criteria (txtCriteria) and a button to apply the filter (btnFilter).
I am using the OnClick event of the button to trigger the filter:
SetTempVar(Field, =[cboField])
SetTempVar(Criteria, =[txtCriteria])
SetFilter(=[TempVars]![Field] Like [TempVars]![Criteria], subDatasheet)
When I manually entered the criteria as a string the filter works fine, but with these tempvars the subform filters everything and returns 0 records.
I am not sure if I am passing the TempVars correctly or not, this is my first time working with Access Web Forms.
I will post a picture of my form so that you can get a better understanding of what I am trying to accomplish.
Thanks in advance for any help!