Filter Main form

  • Thread starter Thread starter agarwalp
  • Start date Start date
A

agarwalp

Hi,

I have a continous form which shows all the equipments. I have a combo
box on the form. If the user selects any value from combo box i want
the form to show only that record. I tried to change the recordsource
property of the form but it did not work. I even tried to apply filter
as below

me.filter="equip =" & desc
me.filteron=true

but it gave me an error saying you cannot assign values at runtime. Can
anyone help me on this.

Thanks
 
Hi,

I have a continous form which shows all the equipments. I have a combo
box on the form. If the user selects any value from combo box i want
the form to show only that record. I tried to change the recordsource
property of the form but it did not work. I even tried to apply filter
as below

Show us your Recordsource
If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 
Andi said:
Show us your Recordsource
If you expect an answer to a personal mail, add the word "manfred" to
the first 10 lines in the message

Here is my recordsource:

strsql="SELECT Items.Equip_Code, Items.Equip_Description,Items.Remarks
FROM Items where Items.Equip_name ' " & cmbEquipName.Value & " '"
Me.RecordSource = strsql

When i run this the form shows a blank record.

And when i apply filter it gives an error "ou can't asign value to this
object"

Thanks
 
Here is my recordsource:

strsql="SELECT Items.Equip_Code, Items.Equip_Description,Items.Remarks
FROM Items where Items.Equip_name ' " & cmbEquipName.Value & " '"
Me.RecordSource = strsql
look at where Items.Equip_name ' " & cmbEquipName.Value & " '"

it should read: where Items.Equip_name = '" &cmbEquipName & "'"

no blank after the ' , because it will add a blank the cmbEquipName
the same applies afterward

and you missed the equal sign, or any other operator

If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 
Back
Top