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 / February 2006

Tip: Looking for answers? Try searching our database.

OpenForm  WhereCondition=Variable

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave Hoder - 23 Feb 2006 20:57 GMT
Can someone tell me how to open a form to show only records defined by a
variable? My code works if I type a literal number in but I can't figure out
how do it with a variable:
   Dim stDocName As String
   Dim stLinkCriteria As String
   Dim MyVariable As Long
   
   txtECRNumber.SetFocus
   MyVariable = txtECRNumber.Text
   stDocName = "subfECRTasks"
   
   DoCmd.OpenForm stDocName, , , "ECRNumber = MyVariable"
Brian Bastl - 23 Feb 2006 21:02 GMT
>     DoCmd.OpenForm stDocName, , , "ECRNumber =" & MyVariable

Brian

> Can someone tell me how to open a form to show only records defined by a
> variable? My code works if I type a literal number in but I can't figure out
[quoted text clipped - 8 lines]
>
>     DoCmd.OpenForm stDocName, , , "ECRNumber = MyVariable"
Dave Hoder - 23 Feb 2006 21:27 GMT
Thank You Brian!

> >     DoCmd.OpenForm stDocName, , , "ECRNumber =" & MyVariable
>
[quoted text clipped - 13 lines]
> >
> >     DoCmd.OpenForm stDocName, , , "ECRNumber = MyVariable"
 
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.