G
Guest
The following reference works when it is present on the active loaded form:
"=Forms!frmMainTab!cboVendor"; however, it will not work on any other form,
or on a report, or in a query. I think it is my understanding that I should
use "=Forms!Me!cboVendor" when referencing the active loaded form, but that
does not work for me either.
How do I properly reference a combo box on a form when running a query that
is embedded in a report?
Here's what I currently have. (You should probably be able to ignore all
but the last couple of lines, and I wish you would because I did not write
this query, nor am I eager to take credit for it.):
SELECT ManInfo.L1, IIf([L1]="E","Electronic Manuals","") AS L2Electronic,
IIf([L1]="RC","Recalled Manuals","") AS L2Recalledt, IIf([L1]="BC","Boeing
Cartridges","") AS L2BoeingCart, IIf([L1]="BP","Boeing Paper Manuals","") AS
L2BoeingPaper, IIf([L1]="MC","Miscellaneous Cartridges","") AS L2MiscCart,
IIf([L1]="PC","Pratt & Whitney Cartridges","") AS L2PrattCart,
IIf([L1]="PP","Pratt & Whitney Paper Manuals","") AS L2PrattPaper, IIf([L1]
Is Null,"Unknown Manuals - L1 Type Not Completed","") AS L2UnknownManual,
IIf([L1]="SP","Spirit Paper Manuals","") AS L1SpiritPaper,
[L1]+LTrim(Str([L2])) AS L1Show, ManInfo.L2,
IIf(ManInfo!MediaType="Electronic","File Name is: " & ManInfo!FileName,"") AS
FileNameYes, [MediaType]+" / "+Trim(Str([MediaNum])) AS MediaShow,
ManInfo.LibID, ManInfo.ManID, ManInfo.ManTitle, ManInfo.Vendor,
ManInfo.ManTyp, ManInfo.FileName, ManInfo.ATA, ManInfo.MediaType,
ManInfo.MediaNum, ManInfo.CurRevNum, ManInfo.CurRevDate, ManInfo.CurTRNum,
ManInfo.CurTRDate, ManInfo.LastAud, ManInfo.AnnCost, ManInfo.AnnDupCost,
ManInfo.[FN-Dir]
FROM ManInfo
WHERE (((ManInfo.ManID)<>0) AND
((ManInfo.Vendor)=[Forms]![frmMainTab]![cboVendor]))
ORDER BY ManInfo.ManTitle;
(BTW, I did not write this original query, nor did I design the original
database, and I do hope to someday replace the entire mess; however, if I can
not even get the syntax right to make this one simple update, I will never be
able to take on the entire project.)
"=Forms!frmMainTab!cboVendor"; however, it will not work on any other form,
or on a report, or in a query. I think it is my understanding that I should
use "=Forms!Me!cboVendor" when referencing the active loaded form, but that
does not work for me either.
How do I properly reference a combo box on a form when running a query that
is embedded in a report?
Here's what I currently have. (You should probably be able to ignore all
but the last couple of lines, and I wish you would because I did not write
this query, nor am I eager to take credit for it.):
SELECT ManInfo.L1, IIf([L1]="E","Electronic Manuals","") AS L2Electronic,
IIf([L1]="RC","Recalled Manuals","") AS L2Recalledt, IIf([L1]="BC","Boeing
Cartridges","") AS L2BoeingCart, IIf([L1]="BP","Boeing Paper Manuals","") AS
L2BoeingPaper, IIf([L1]="MC","Miscellaneous Cartridges","") AS L2MiscCart,
IIf([L1]="PC","Pratt & Whitney Cartridges","") AS L2PrattCart,
IIf([L1]="PP","Pratt & Whitney Paper Manuals","") AS L2PrattPaper, IIf([L1]
Is Null,"Unknown Manuals - L1 Type Not Completed","") AS L2UnknownManual,
IIf([L1]="SP","Spirit Paper Manuals","") AS L1SpiritPaper,
[L1]+LTrim(Str([L2])) AS L1Show, ManInfo.L2,
IIf(ManInfo!MediaType="Electronic","File Name is: " & ManInfo!FileName,"") AS
FileNameYes, [MediaType]+" / "+Trim(Str([MediaNum])) AS MediaShow,
ManInfo.LibID, ManInfo.ManID, ManInfo.ManTitle, ManInfo.Vendor,
ManInfo.ManTyp, ManInfo.FileName, ManInfo.ATA, ManInfo.MediaType,
ManInfo.MediaNum, ManInfo.CurRevNum, ManInfo.CurRevDate, ManInfo.CurTRNum,
ManInfo.CurTRDate, ManInfo.LastAud, ManInfo.AnnCost, ManInfo.AnnDupCost,
ManInfo.[FN-Dir]
FROM ManInfo
WHERE (((ManInfo.ManID)<>0) AND
((ManInfo.Vendor)=[Forms]![frmMainTab]![cboVendor]))
ORDER BY ManInfo.ManTitle;
(BTW, I did not write this original query, nor did I design the original
database, and I do hope to someday replace the entire mess; however, if I can
not even get the syntax right to make this one simple update, I will never be
able to take on the entire project.)