Wednesday, 15 May 2013

vba - Created a Report based on a value from Combo box in form -



vba - Created a Report based on a value from Combo box in form -

i need help solving problem of forms , reports , need create form combo box select companies , button view study values on selected company combo box, how can , created combo box , when press preview button displays me companies :(, suggestions????? here vba code:

option compare database private sub button_click() 'forms!formfirmkarnet.visible = false docmd.openreport "firmkarnet", acviewpreview end sub private sub close_click() docmd.close acform, "formfirmkarnet" end sub private sub id_afterupdate() forms!formfirmkarnet!code_company = forms!formfirmkarnet!id.column(1) end sub private sub id_lostfocus() forms!formfirmkarnet!code_company = forms!formfirmkarnet!id.column(1) end sub

in case can open study where filter:

docmd.openreport "reportname", acviewpreview, , "company_id = " & me.comboboxname

this presumes combobox has id field bound column , field called company_id in query of report. combobox not need more code this, might have check if selected before opening report.

vba ms-access access-vba

No comments:

Post a Comment