vba - OpenArgs not passing variable to report -
vba - OpenArgs not passing variable to report -
i pretty new vba , i'm trying create button on invoice creation form print invoice. on click event of button should open study , assign invoice id on form openargs property.
private sub cmdprint_click() dim invoicenum integer if me.dirty 'save edits. me.dirty = false end if if me.newrecord 'check there record print msgbox "select record print" else invoicenum = me.[invoice number] docmd.openreport "invoice", acviewpreview, , , , invoicenum end if end sub
then when study opens runs code:
dim invoicenum integer invoicenum = me.openargs
when click button on form however, come in parameter box appears. whats unusual the text in box value of invoice number want assign openargs property. cant work out how create value of openargs invoice number form.
i'm not sure have done wrong , can't seem find reply anywhere. help appreciated.
dim invoicenum integer invoicenum = me.openargs
something looks off when open study declaring variable called invoicenum , setting value of variable open args. i'm not sure intend variable. if objective filter invoice invoice number should seek this...
me.filter = "[invoice number]= " & me.openargs
alternatively think happening have unbound command on form command source invoicenum
, trying set value of openargs. because unbound command whenever form opens give parameter box because invoicenum
not field on table. if right , happening can seek setting command source of straight open args using =[openargs]
in command source , removing code onload event of form.
vba ms-access openargs
Comments
Post a Comment