If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
OpenForm WhereCondition=Variable
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" |
#2
|
|||
|
|||
OpenForm WhereCondition=Variable
DoCmd.OpenForm stDocName, , , "ECRNumber =" & MyVariable
Brian "Dave Hoder" wrote in message ... 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" |
#3
|
|||
|
|||
OpenForm WhereCondition=Variable
Thank You Brian!
"Brian Bastl" wrote: DoCmd.OpenForm stDocName, , , "ECRNumber =" & MyVariable Brian "Dave Hoder" wrote in message ... 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" |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Openform with Wherecondition causes Parameter entry request | Ace9x | Using Forms | 1 | September 28th, 2005 07:38 PM |
"The OpenForm action was canceled" | John Phelan-Cummings via AccessMonster.com | Using Forms | 3 | August 4th, 2005 03:04 PM |
OpenForm Action Cancelled | Jan Il | Using Forms | 10 | November 29th, 2004 04:17 AM |
2003 OpenForm, Magnified and in Larger Window | Jim Shores | Setting Up & Running Reports | 0 | July 7th, 2004 11:07 PM |
OpenForm command | Dan Cole | New Users | 2 | May 18th, 2004 10:24 PM |