In the past I have always used macros but am trying to break the habit and have got stuck. I have searched and searched but must be missing something. I am trying to open a report from a button on a form however, the report shows all records not the one I am trying to specify with the [ID_Student] primary key. Heres the code I have;
stLinkCriteria = "[ID_Student]=" & Me![ID_Student]
DoCmd.OpenReport "r-StudentProfile", acViewPreview, , , , "[ID_Student]=" & Me![ID_Student]
Any help would be appreciated.
*I found the problem, right after posting this... to many commas after acViewPreview,, should have only been 2. Being a VBA newbie perhaps someone could explain the significance of the commas, cheers.