vba - Access FindFirst/FindNext returns Operation is not supported in this type of object -
i have code:
sub printpdfpagestest(formname string, filename string) ''print each record separate pdf file, named according invoice number dim rs recordset dim wherecondition string dim savename string dim strtemp2 long strtemp2 = 2281821648 set rs = currentdb.openrecordset(filename) ''can pass sql in string ''add msgbox: create number input invoicenumber ''get value invoicenumber = inputbox ("enter starting invoice num"...) ''get value end invoicenumber = inputbox("enter ending invoice num"...) ''get start value starting location (findrecord) -----need plan step out. ''add if statement in while loop. if condition not end invoice number, keep going rs.findnext "[invoicenumber]=" & strtemp2 docmd.close acform, formname rs.close set rs = nothing end sub
what want find position of strtemp2
invoice number in table , use movenext
, moveprevious
on record navigate around table.
i keep getting error message:
operation not supported type of object.
this happens on line:
set rs = currentdb.openrecordset(filename)
i tried changing rs
to:
dim rs recordset
however still gives me same error.
you can't open recordset file name. first open database, recordset.
Comments
Post a Comment