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
|
|||
|
|||
=[forms]![main menu]![from %] And =[forms]![main menu]![To %]
=[forms]![main menu]![from %] And =[forms]![main menu]![To %] or Like
=[forms]![Main Menu]![From %] & "*" Can someone tell me what is wrong with this? I have this on a query and I want to pull a report using these parameters. Part of it works fine but when I want to get all records I get a blank report. I have tried different ways of doing this but I can never get it to work. Please help. I've also tried =[forms]![main menu]![from %] And =[forms]![main menu]![To %] or =[forms]![Main Menu]![From %] Is null |
#2
|
|||
|
|||
=[forms]![main menu]![from %] And =[forms]![main menu]![To %]
Switch your query to SQL View (View menu, in query design.)
In the WHERE clause you will see something like this: WHERE [Table1].[Field1] = [forms]![Main Menu]![From %] AND [Table1].[Field1] = [forms]![Main Menu]![To %] Change it to this kind of thing: WHERE ([forms]![Main Menu]![From %] Is Null OR [Table1].[Field1] = [forms]![Main Menu]![From %]) AND ([forms]![Main Menu]![To %] Is Null OR [Table1].[Field1] = [forms]![Main Menu]![To %]) The bracketing is important here. Each part of the WHERE clause evaulates to True or False. If the from text box is blank, then: [forms]![Main Menu]![From %] Is Null is true. If it is not blank, the only way first part can evalute to True is if the field is indeed greater than the text box value. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "brown_eyes" wrote in message ... =[forms]![main menu]![from %] And =[forms]![main menu]![To %] or Like =[forms]![Main Menu]![From %] & "*" Can someone tell me what is wrong with this? I have this on a query and I want to pull a report using these parameters. Part of it works fine but when I want to get all records I get a blank report. I have tried different ways of doing this but I can never get it to work. Please help. I've also tried =[forms]![main menu]![from %] And =[forms]![main menu]![To %] or =[forms]![Main Menu]![From %] Is null |
Thread Tools | |
Display Modes | |
|
|