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
|
|||
|
|||
Conditional formatting with SQL Select from another table
Hi,
I trying to set the font color in a textbox using this "Expression is": [txtProdAvailableDate]=Date() And [ProdAvailableChk]=-1 And [txtProdAvailableDate](SELECT [tblLog].[ProdAvCheckedDate] FROM [tblLog] WHERE [ID]=Forms![frmTracing].[txtID]). This doesn't give any error message but neither does it change the font color. I have this expression working: [txtProdAvailableDate]=Date() And [ProdAvailableChk]= 0 Any suggestion on how to solve the string where I use the SELECT statement? Cheers, /Mag |
#2
|
|||
|
|||
Conditional formatting with SQL Select from another table
You can't use SELECT statements like that. Try using DLookup:
[txtProdAvailableDate]DLookup("[ProdAvCheckedDate]", "[tblLog]", "[ID]=" & Forms![frmTracing].[txtID]) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "MagnusS" wrote in message ... Hi, I trying to set the font color in a textbox using this "Expression is": [txtProdAvailableDate]=Date() And [ProdAvailableChk]=-1 And [txtProdAvailableDate](SELECT [tblLog].[ProdAvCheckedDate] FROM [tblLog] WHERE [ID]=Forms![frmTracing].[txtID]). This doesn't give any error message but neither does it change the font color. I have this expression working: [txtProdAvailableDate]=Date() And [ProdAvailableChk]= 0 Any suggestion on how to solve the string where I use the SELECT statement? Cheers, /Mag |
#3
|
|||
|
|||
Conditional formatting with SQL Select from another table
MagnusS -
You might try putting a hidden field on your form, and setting the value to be the results of your SQL statement. Then in your formatting expression, use the value of this hidden field instead of the SQL statement. -- Daryl S "MagnusS" wrote: Hi, I trying to set the font color in a textbox using this "Expression is": [txtProdAvailableDate]=Date() And [ProdAvailableChk]=-1 And [txtProdAvailableDate](SELECT [tblLog].[ProdAvCheckedDate] FROM [tblLog] WHERE [ID]=Forms![frmTracing].[txtID]). This doesn't give any error message but neither does it change the font color. I have this expression working: [txtProdAvailableDate]=Date() And [ProdAvailableChk]= 0 Any suggestion on how to solve the string where I use the SELECT statement? Cheers, /Mag |
Thread Tools | |
Display Modes | |
|
|