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 / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Setting RecordSource on Subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Scarlett - 20 Apr 2005 13:05 GMT
Hi! I've been looking at other questions posted here and have tried to
replicate one of the solutions proposed with no success.
I have a form and an (unlinked) subform. When users select a value from the
combo I want to set the Record Source for the subform to an SQL string which
uses said value ie SQLstring = "Select JobID FROM Job (where JobID = " &
cmbo.Value & ")" At present I get Error 30025 - 'Invalid SQL string. Check
Server Filter on Form record source.'
I don't have any filters (either on the form or on the server) I have
Debug.Printed  my SQL and it looks fine .... Please, what am I doing wrong?
Rob Parker - 20 Apr 2005 14:37 GMT
Try
   SQLstring = "Select JobID FROM Job where (JobID = " & cmbo.Value & ")"

You've got the opening ( before the WHERE, rather than after.  You could
omit the bracketing here, since it's not needed to force an evaluation
order.  You may also need a closing ; in the SQL string.  All of this may
mean that what you really need is:
   SQLstring = "Select JobID FROM Job where JobID = " & cmbo.Value & ";"

HTH,

Rob

> Hi! I've been looking at other questions posted here and have tried to
> replicate one of the solutions proposed with no success.
[quoted text clipped - 5 lines]
> I don't have any filters (either on the form or on the server) I have
> Debug.Printed  my SQL and it looks fine .... Please, what am I doing wrong?
 
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.