developingprogrammer
asked on
dlookup parameter queries
guys!! super silly question but thought i'd just ask it anyway haha = )
is it technically possible to dlookup a parameter query?
i think it's not possible cause we're passing a string into the dlookup function for the domain.
also, having the parameter in the query is already a dlookup. just that of course we're returning a recordset instead of a single value.
let me know how silly you think this question is!! thanks!! haha = ))
is it technically possible to dlookup a parameter query?
i think it's not possible cause we're passing a string into the dlookup function for the domain.
also, having the parameter in the query is already a dlookup. just that of course we're returning a recordset instead of a single value.
let me know how silly you think this question is!! thanks!! haha = ))
ASKER
thanks Bill! how would you do it? how would you input the parameters? in a querydef object? if so then how do you look up that unsaved querydef object?
Hi,
Put the dlookup statement where the parameter is:
With parameter:
SELECT * FROM myTable WHERE ID = [My Parameter]
With DLookup (assuming myField is a text field:
SELECT * FROM myTable WHERE ID = DLookup("ID",myLookupTable ,"myField= 'myValue'" )
Regards,
Bill
Put the dlookup statement where the parameter is:
With parameter:
SELECT * FROM myTable WHERE ID = [My Parameter]
With DLookup (assuming myField is a text field:
SELECT * FROM myTable WHERE ID = DLookup("ID",myLookupTable
Regards,
Bill
BTW -
With DLookup using a parameter as part of the lookup:
SELECT * FROM myTable WHERE ID = DLookup("ID",myLookupTable ,"myField= '" & [My Parameter] & "'")
With DLookup using a parameter as part of the lookup:
SELECT * FROM myTable WHERE ID = DLookup("ID",myLookupTable
ASKER
thanks Bill!
what i meant was can i do something like this
DLookup("RowID","qryMyPara meterQuery ")
where qryMyParameterQuery takes say 2 parameters?
i don't think that is possible but i would love to be corrected! thanks!! = )
what i meant was can i do something like this
DLookup("RowID","qryMyPara
where qryMyParameterQuery takes say 2 parameters?
i don't think that is possible but i would love to be corrected! thanks!! = )
Hi,
Sure you can. Just join the query correctly and the dlookup will work fine.
FYI - I would use a form to hold the parameter variables so you don't have to retype them and the values may be looked up insted.
Regards,
Bill
Sure you can. Just join the query correctly and the dlookup will work fine.
FYI - I would use a form to hold the parameter variables so you don't have to retype them and the values may be looked up insted.
Regards,
Bill
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
great! thanks so much guys! = ))
Of course you can.
Regards,
Bill