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
|
|||
|
|||
searching from a form
Hi,
I'm really struggling with the process of setting my query criteria via a form. I'm essentially trying to combine 3 query parameter dialogs into 1 form. I've tried everything, macros - hit search button, openQuery etc. code - Me.Visible = False DoCmd.OpenQuery "qryByExperience", acViewNormal, acEdit DoCmd.Close acForm, "frmSearch" These are on the onClick event of my search form. Within the query i'm using the following format within the criteria rows, Forms![FormName]![ControlName] I'm able to open the query, but get no results. I know the matching records are there, and if I run the query and handle each query parameter 1 by 1 I get the desired results. I'm missing something but don't know what. The form uses combo boxes that utilise the lookup wizard lookup. I've run through Microsoft's examples with theirnorthwind db but am even struggling with that. Are there any settings I could have wrong? Hope someone can help, fingers tightly crossed, Rob |
#2
|
|||
|
|||
Hi, Rob.
I *think*, from what you've said, that you're trying to apply a filter to a recordset on a form based on one or more criteria you've provided on a form. Is this correct? And if so, is the criteria entered to be matched exactly or as a wildcard? For example, if you provide combo boxes limited to list, the user will only be able to select amongst the previously entered items, but if you provide a CustomerName textbox, and intend that the query return any partial match, that's something different. Please post your intention and I can help. Sprinks "Rob Parsons" wrote: Hi, I'm really struggling with the process of setting my query criteria via a form. I'm essentially trying to combine 3 query parameter dialogs into 1 form. I've tried everything, macros - hit search button, openQuery etc. code - Me.Visible = False DoCmd.OpenQuery "qryByExperience", acViewNormal, acEdit DoCmd.Close acForm, "frmSearch" These are on the onClick event of my search form. Within the query i'm using the following format within the criteria rows, Forms![FormName]![ControlName] I'm able to open the query, but get no results. I know the matching records are there, and if I run the query and handle each query parameter 1 by 1 I get the desired results. I'm missing something but don't know what. The form uses combo boxes that utilise the lookup wizard lookup. I've run through Microsoft's examples with theirnorthwind db but am even struggling with that. Are there any settings I could have wrong? Hope someone can help, fingers tightly crossed, Rob |
#3
|
|||
|
|||
Hi,
I'm aiming to use the form purely as a method of providing the user with the required search criteria. By using the 3 combo boxes (limited to list) I want to provide them with the defined areas on which they can search, rather than just let them search on anything. Via this form I'm trying to 'feed' my query with 3 criteria on which to search, after hitting a 'Search' or 'OK' cmd button. Hopes this helps define the problem, Thanks Spinks "Sprinks" wrote: Hi, Rob. I *think*, from what you've said, that you're trying to apply a filter to a recordset on a form based on one or more criteria you've provided on a form. Is this correct? And if so, is the criteria entered to be matched exactly or as a wildcard? For example, if you provide combo boxes limited to list, the user will only be able to select amongst the previously entered items, but if you provide a CustomerName textbox, and intend that the query return any partial match, that's something different. Please post your intention and I can help. Sprinks "Rob Parsons" wrote: Hi, I'm really struggling with the process of setting my query criteria via a form. I'm essentially trying to combine 3 query parameter dialogs into 1 form. I've tried everything, macros - hit search button, openQuery etc. code - Me.Visible = False DoCmd.OpenQuery "qryByExperience", acViewNormal, acEdit DoCmd.Close acForm, "frmSearch" These are on the onClick event of my search form. Within the query i'm using the following format within the criteria rows, Forms![FormName]![ControlName] I'm able to open the query, but get no results. I know the matching records are there, and if I run the query and handle each query parameter 1 by 1 I get the desired results. I'm missing something but don't know what. The form uses combo boxes that utilise the lookup wizard lookup. I've run through Microsoft's examples with theirnorthwind db but am even struggling with that. Are there any settings I could have wrong? Hope someone can help, fingers tightly crossed, Rob |
#4
|
|||
|
|||
Hi,
I've got the form working with a couple of filters, with the criteria being entered into txt boxes. It would be good if I could use combo boxes instead. I thought it would be a simple matter of changing the code to reference the cbo boxes rather than the txt boxes, unfortunately this doesn't seem to be the case. ..... DoCmd.ApplyFilter , "[PT_ProjectType] = '" & Me.txtProject & "'" DoCmd.ApplyFilter , "[BT_BuildingType] = '" & Me.txtBuilding & "'" ..... Any ideas on what I'm missing? Very new to this and all help is much appreciated. Thanks, Rob "Sprinks" wrote: Hi, Rob. I *think*, from what you've said, that you're trying to apply a filter to a recordset on a form based on one or more criteria you've provided on a form. Is this correct? And if so, is the criteria entered to be matched exactly or as a wildcard? For example, if you provide combo boxes limited to list, the user will only be able to select amongst the previously entered items, but if you provide a CustomerName textbox, and intend that the query return any partial match, that's something different. Please post your intention and I can help. Sprinks "Rob Parsons" wrote: Hi, I'm really struggling with the process of setting my query criteria via a form. I'm essentially trying to combine 3 query parameter dialogs into 1 form. I've tried everything, macros - hit search button, openQuery etc. code - Me.Visible = False DoCmd.OpenQuery "qryByExperience", acViewNormal, acEdit DoCmd.Close acForm, "frmSearch" These are on the onClick event of my search form. Within the query i'm using the following format within the criteria rows, Forms![FormName]![ControlName] I'm able to open the query, but get no results. I know the matching records are there, and if I run the query and handle each query parameter 1 by 1 I get the desired results. I'm missing something but don't know what. The form uses combo boxes that utilise the lookup wizard lookup. I've run through Microsoft's examples with theirnorthwind db but am even struggling with that. Are there any settings I could have wrong? Hope someone can help, fingers tightly crossed, Rob |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tell if Form is a Dialog | Alex | Using Forms | 7 | August 30th, 2005 06:22 PM |
Combo Box NotInList - How To Add Data To Underlying Table | 10SNUT | Using Forms | 19 | July 8th, 2005 09:12 PM |
Default values to load up automatically in a form based on value entered in another form | Anthony Dowd | Using Forms | 8 | August 12th, 2004 08:53 AM |
Searching Records | Melissa Lambino | New Users | 6 | July 20th, 2004 04:51 AM |
auto entry into second table after update | Tony | New Users | 13 | July 9th, 2004 10:42 PM |