vba - How to use checkboxes to get data -
I have a forum called Frame Aid, which is receiving data from a table named "agent" in this table "Agent's Name ". Under this clan, the name" Chris "is" Nikita "" No "," Jennifer "and" Diane ". In the forum, I have a check box next to a check box with these names. All the different checkboxes of the course. What I need to do is enable me to run my query which will receive data from "agent" from the platform in which each checkbox will be marked
Example if I have a check box marked for Chris and Diane, So I have to catch all the data from the table "agent". If only one of them has been marked, grab that person's data.
Does this make sense? Can you please help me? I am very new to VBA and access. Example and coding will help a lot Thank you in advance.
On the assumption you have the "submit" or "filter" command button, You can use:
strfilter = "" as if the string is dim in the form of a slow strfilter. If me.chkbox1.Value = true then strfilter = "([agent's name] = ' & Amp; Me.Name1Value & amp; "'and" IF "if I.chkbox2.Value = true then strfilter = strfilter & amp; ([agent's name] ='" & Me.Name2Value & amp; & Amp; & amp; iF & lt; & lt; & lt; & lt; many times as required & gt; & gt; if right (strfilter, 4) = "and" then i = take (Strfilter) Strfilter = left (strfilter, i-4) me.Filter = Strfilter me.FilterOn = True Me.Requery i = Me.Recordset.RecordCount If I = 0 then MsgBox "no record is selected", vbOKOnly, " No Records "'If you want you can delete the filter and the request. If the end if
Comments
Post a Comment