automating access from vb.net

mech55

Member
Joined
Jan 26, 2005
Messages
13
Programming Experience
1-3
this is the code I have, am I missing something, because I'm able to open my db and the conditions for my report come up, but the actuall report isn't opening. This is code for opening a preview but when I try to open a normal report I get an exception thrown at me.

try
dim oAccess as access.application
oAccess=New Access.ApplicationClass

OAccess.OpencurrentDatabase(filepath:="C:\Databases\field repair Traver.mdb", exclusive:=true)

oAccess.DoCmd.openreport(reportname:="Fr Date Range total", View:=Access.AcView.acViewPreview)
catch ex as exception
messagebox.show(ex.message)
end try
 
well, I just kinda figured it out. I needed to set the oAccess.visible=true. That's why the report wasn't appearing even though I saw it in services. As far as printing, I was trying to print to my home printer and wasn't at home lol.

thanks,
 
Back
Top