Filter subform using combobox -


It took me about 2 weeks and I do not know what to do and what to do. I have a main form (UserSearch) that has a subform (TestUserSub) for both forms, the associated table is Tebsler very easy; Mainly (UserSearch) I have a ComboBox associated with Tblusers such as cmbid, cmbname, cmbdept fields and so on. I want all to be connected to any of these combiboxs for a user and to display in the subform (TestUserSub) for related fields. Is I've tried several different versions of the code after update event in Comboboks and subForm or in other instances not even, I get the error message is an example filtering by running an SQL command I've tried is

  private sub cmbid_AfterUpdate () select dim as strSQL string IsNull (Me.cmbaccess) then Me.RecordSource = "tblusers" rest strSQL = "TblUsers. [team Sdasy_aidi] TblUsers "& amp; _ "Ou (((tblUsers [Team Member_ID])." & Amp;. [Form_testusersub] [txtid2])) & amp; "," Me.RecordSource = strSQL termination if end sub  

did not work above ... can anyone help me with this. I have a sample database which I am working very oddly and managed to do this without calling any code. Is this possible?

After the

I was able to figure out the code using the sample

 
 < code> select Private sub yourcombobox_AfterUpdate () as dim LSQL string IsNull (Me.yourcombobox.Value) then Form_yoursubform.RecordSource = "tablename" Me.yoursubform.Requery requerysubform 'macro entirely or LSQL = requery to "* "LSQL = LSQL & Tablename" "Where field = '" & amp; Your combobox & amp; " '" Form_yoursubform.RecordSource = does LSQL requerysubform' macro end of the form to requery End Sub  

hope this helps you.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -