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
|
|||
|
|||
Using a parameter
I have a form (FormA) which has a subform(FormB). One of the listboxes on
FormB uses a query using a field from FormB as part of the where statement. I've tried various versions of [forms]![FormA]![FormB].Form![PD_Date] in the where statement. The query prompts for the value and if I enter it, the query runs fine. When I try to run it on FormB, it prompts for the value. Can anyone let me know what I'm doing wrong? |
#2
|
|||
|
|||
Using a parameter
Likely the name of the subform control that is holding "FormB" as the
subform is not named FormB. Open your main form in design view, click on the top edge of the subform control that is holding FormB as the subform, open Properties window, click on Name tab, and see what the name of the subform control is. Use that name instead of FormB in the reference. -- Ken Snell http://www.accessmvp.com/KDSnell/ "PeterM" wrote in message ... I have a form (FormA) which has a subform(FormB). One of the listboxes on FormB uses a query using a field from FormB as part of the where statement. I've tried various versions of [forms]![FormA]![FormB].Form![PD_Date] in the where statement. The query prompts for the value and if I enter it, the query runs fine. When I try to run it on FormB, it prompts for the value. Can anyone let me know what I'm doing wrong? |
#3
|
|||
|
|||
Using a parameter
If the list box is in FormB and the control being referenced as the parameter
is also in FormB you shouldn't need to reference the parent form at all. The following should work whether FormB is opened directly or as a subform: Form![PD_Date] In fact simply referencing the control by name should work: [PD_Date] but I prefer to qualify it with the Form property to avoid any possible ambiguity as to what is being referenced. Ken Sheridan Stafford, England PeterM wrote: I have a form (FormA) which has a subform(FormB). One of the listboxes on FormB uses a query using a field from FormB as part of the where statement. I've tried various versions of [forms]![FormA]![FormB].Form![PD_Date] in the where statement. The query prompts for the value and if I enter it, the query runs fine. When I try to run it on FormB, it prompts for the value. Can anyone let me know what I'm doing wrong? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/201002/1 |
Thread Tools | |
Display Modes | |
|
|