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 / Modules / DAO / VBA / May 2005

Tip: Looking for answers? Try searching our database.

Syntax Operator Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 30 Apr 2005 15:40 GMT
this is one of them small problems that i can just never figure out. The
following code should simply open the report where the values are equal. I
can find them manually so i know they are deffinately linked correctly
however i think its a problem with the various operators to call the
variable. MAny thanks for any help in advance.

Dim LinkRequest As String
LinkRequest = [Forms]![frmRequest]![NewRequestID]

DoCmd.OpenReport "rptRequestHardCopy", acViewPreview, , "[NewRequestID] = &
LinkRequest &"
Tim Ferguson - 30 Apr 2005 15:52 GMT
> DoCmd.OpenReport "rptRequestHardCopy", acViewPreview, , _
> "[NewRequestID] = & LinkRequest &"

The criterion part is wrong: you need to pass the contents of the
LinkRequest string, not its name. Try this:

 DoCmd.OpenReport "rptRequestHardCopy", acViewPreview, , _
     "[NewRequestID] = " & LinkRequest

If the NewRequestID field is a Text type, then you'll need the
appropriate delimiters:

LinkRequest = Chr$(34) &
   Replace(Forms!frmRequest!NewRequestID, chr$(34), String(34,2)) & _
   Chr$(34)

Hope that helps

Tim F
Mike - 30 Apr 2005 16:11 GMT
Thanks Tim. That is spot on, works great now thanks to you. Shame you can't
buy people pints over this thing.

> > DoCmd.OpenReport "rptRequestHardCopy", acViewPreview, , _
> > "[NewRequestID] = & LinkRequest &"
[quoted text clipped - 15 lines]
>
> Tim F
RD - 02 May 2005 18:10 GMT
>Thanks Tim. That is spot on, works great now thanks to you. Shame you can't
>buy people pints over this thing.

Har!  That's what we need!  A virtual pub to let people know how much we
appreciate their help by buying them virtual pints!

Here's a pint for you, Mike, for a great idea!

Regards,
RD
 
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.