Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2008

Tip: Looking for answers? Try searching our database.

Run Time Error - 3075

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Monish - 24 Apr 2008 03:03 GMT
An event that calls a query is returning a run-time error and I can't seem to
figure out why...I am sure it is probably fairly simple, and would appreciate
some help from anyone out there:

Private Sub cmdOK_Click()
   DoCmd.OpenQuery "QryRSNoSplitByRep", acViewNormal, acEdit
   DoCmd.Close acForm, "FormForCbo"
End Sub

Thanks!
Jeanette Cunningham - 24 Apr 2008 03:14 GMT
Monish,
instead of using cmdOK to open the query,>
While the form is running, open the query yourself from the database window
and see if there is any problem with opening the query.

Jeanette Cunningham

> An event that calls a query is returning a run-time error and I can't seem
> to
[quoted text clipped - 8 lines]
>
> Thanks!
Monish - 24 Apr 2008 03:29 GMT
Jeanette

The interesting thing is that I created this database for a colleague and
she is having the issue on her end after I sent her the db.  The version I
house on my end doesn't give me the error...does that make any sense?

So, I can open the query fine using the control on the form...

Thx

> Monish,
> instead of using cmdOK to open the query,>
[quoted text clipped - 15 lines]
> >
> > Thanks!
Jeanette Cunningham - 24 Apr 2008 04:22 GMT
Monish,
it makes it much harder to figure out what is going wrong.
One way to find out is to put some code in that form to try to track what is
going on.
Then send her a new database with the updated form in it.
You can for example put code in the form to write some results to a temp
table in her front end.
It would be much easier to visit your colleague and debug on her machine.

It is very unusual to open a query in code anyway. Perhaps if you explain
what the form is doing and how it is using the query we could suggest
another approach that is less error prone.

Jeanette Cunningham

> Jeanette
>
[quoted text clipped - 27 lines]
>> >
>> > Thanks!
Monish - 25 Apr 2008 04:17 GMT
Jeanette - thanks for responding firstly.

Unfortunately the other database is across the country or I might indeed
have stopped by in person.

This is a form in which the user executes a parameter query with a selection
from a drop down box, then clicking OK.  It is meant to be able to run a
similar report for various Reps listed in the drop down...when she clicks ok
after making her selection she gets the Run Time Error 3075 message and if
she selects Debug it opens up the Script Editor and hghlights the line:

DoCmd.OpenQuery "QryRSNoSplitByRep", acViewNormal, acEdit

Is there perhaps some syntax that might be invalid for different versions of
Access? Again, this same code works fine for me using Access 2003; she may
have Access 2000.  I can check that however.

I am not sure what you mean by putting extra code in the form...what event
should trigger that code?

Thanks again!

> Monish,
> it makes it much harder to figure out what is going wrong.
[quoted text clipped - 42 lines]
> >> >
> >> > Thanks!
Jeanette Cunningham - 25 Apr 2008 04:50 GMT
Monish,
from your post it seems that you are using the drop down to choose a rep and
then run a report for that rep.
I suggest to avoid a parameter query and avoid opening the query altogether.

You can open a report from the combo directly, like this:
DoCmd.OpenReport "NameOfYourReport", , "[RepID] = " & Me.cboReps & "

The above will open the report for the RepID chosen in the drop down with
rep names.
If RepID is a text field, change it to
--> DoCmd.OpenReport "NameOfYourReport", , "[RepID] = """ & Me.cboReps &
""""

Replace NameOfYourReport, RepID and cboReps with your report, control and
field names.

Jeanette Cunningham

> Jeanette - thanks for responding firstly.
>
[quoted text clipped - 71 lines]
>> >> >
>> >> > Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.