Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line of VBA Code - Help Please 1

Status
Not open for further replies.

iamchemist

Programmer
Mar 2, 2009
73
US
Would someone please help me out in understanding what the following line of VBA Code is supposed to do:

Me.FormName.Form.Filter = Mid$(Selection, 5, 999)

This code line follows a series of lines that appear to check to see if certain fields from a second Formname contain anything.

I know that this line of code is selecting the last four digits of an SS# with the Mid$... part, but is it extracting that number from the FormName form or what? Also, I thought the whole "filter" function was something normally applied to a data table, and not a form. Here it seems to be applied to a form.

Thanks in advance for your help,

Ron
 
A form has a filter property. This can be updated in a number of ways including opening the form with a WHERE CONDITION in the DoCmd.OpenForm method.

This code seems to be setting the filter property of a form to a value from the string variable "Selection".


Duane
Hook'D on Access
MS Access MVP
 
Duane,

Got it - I think! Thanks very much for your reply.

Ron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top