Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateObject vs New

Status
Not open for further replies.

stnkyminky

Programmer
Oct 15, 2001
476
0
0
US
I am attempting to execute the following statement. Both of which work on my development machine, but do not work on the client machine. Why?

Set oAccess = New Access.Application
Set oAccess = CreateObject("Access.Application") Scott
Programmer Analyst
 
In Addition:

Im also executing this code below the Set statement. Which results in an "Object variable or With block variable not set" error.
Thanks

strSQL = "Date_shipped = #" & dateShipped & "# AND Trailer_ID = '" & truck & "' AND ID_Job = '" & job & "'"

With oAccess
.Visible = True
.DoCmd.Maximize
.OpenCurrentDatabase "foo.mdb", False
.DoCmd.OpenReport "Bundle_Report_Packing_Scott", acPreview, , strSQL
.DoCmd.OpenReport "Bundle_Report_DataEntry_Scott", acPreview, , strSQL
End With

Set oAccess = Nothing Scott
Programmer Analyst
 
Do you have Access installed on the client machine?

Troy
San Francisco, CA
 
does the client have access?
Ruairi

Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.
 

The client is running MS Access runtime, but the reference MSACC8.OLB is installed on their machine. Scott
Programmer Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top