![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
IF CompartmentText is a string then stLinkCriteria = "CompartmentText='" & TempComp & "'" |
|
stLinkCriteria = "CompartmentText= ' " & TempComp & " ' " |
|
Is TempComp an integer or is it a string value? Is CompartmentText a string value? Since you are not getting an error when you assign compartmentText to tempcomp I am going to assume that they are both integers. In which case your stLinkCriteria line should read stLinkCriteria = "CompartmentText=" & TempComp IF CompartmentText is a string then stLinkCriteria = "CompartmentText=" & TempComp & "'" In both cases you must concatenate the value of TempComp into your expression and not the name of the control. IF you pass in the name of the control, your expression becomes CompartmentText = 'TempComp' and I don't think you have any CompartmentText value that is tempcomp. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County |
#4
| |||
| |||
|
|
Slight correction to John's post: he missed a quote. IF CompartmentText is a string then stLinkCriteria = "CompartmentText='" & TempComp & "'" Exagerated for clarity, that's stLinkCriteria = "CompartmentText= ' " & TempComp & " ' " |
#5
| |||
| |||
|
#6
| |||
| |||
|
#7
| |||
| |||
|
#8
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |