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 / General 1 / January 2006

Tip: Looking for answers? Try searching our database.

MS Access 2002 problem: linked form fields in ODBC queries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
monnomiznogoud@yahoo.com.ar - 09 Jan 2006 13:07 GMT
Ok, my problem is the following:

I have very complicated Access 97 databases that link through ODBC to
Sybase databases.

Now in some of the forms controls I had queries that used as "where
clause" parameters form field values; For example:

    select foo from bar where a_colmun = [forms]![MyForm]![MyField]

This worked in Access 97 but fails in Access 2002 (ODBC failure) when
the table *bar* is an ODBC Sybase (in my case) linked table.

If *bar* were a local Access table, the query would do fine.

if i did

     select foo from bar where a_colmun = (select
[forms]![MyForm]![MyField] from dual)

where *dual* is a table with only one line of data. That works, but it
slows my queries.

Someone have a solution ? (i cannot upgrade to newer versions of
Access)

Thanx in advance
(PeteCresswell) - 09 Jan 2006 14:40 GMT
Per monnomiznogoud@yahoo.com.ar:
>Now in some of the forms controls I had queries that used as "where
>clause" parameters form field values; For example:
[quoted text clipped - 5 lines]
>
>If *bar* were a local Access table, the query would do fine.

Is the SQL in the form's .RecordSource or are you applying it from VBA code?

If it's in .RecordSource, you can probably stop here and move on the next
post...

I've had slightly similar problems when VBS uses a query that refers to a form's
control value.   Query works find when invokes by double clicking the query
object, but can't find the referenced control when invoked from VBA.

Workaround for me was to define a parameter in the query and explicitly load it
in VBA before opening an RS.
Signature

PeteCresswell

monnomiznogoud@yahoo.com.ar - 10 Jan 2006 09:37 GMT
PeteCresswell

>Is the SQL in the form's .RecordSource or are you applying it from VBA code?

It is in the a list's record source in fact.

The IT services suggested to put back the Access 97 Sybase's patch :)

The only solution i found is the one i posted above, an innner select
using the form's field value with a local table (dual, a one-line
oracle-like table i defined)
 
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



©2008 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.