O ootkhopdi Registered User. Local time Today, 16:34 Joined Oct 17, 2013 Messages 181 Aug 10, 2015 #1 Hi pls tell me how can i set creteria in dlookup as =dlookup("Fieldname=1,Tablename=2,creteria1=3,creteria2=4 and creteria 3=5 pls help me i m new user of access 2007
Hi pls tell me how can i set creteria in dlookup as =dlookup("Fieldname=1,Tablename=2,creteria1=3,creteria2=4 and creteria 3=5 pls help me i m new user of access 2007
N namliam The Mailman - AWF VIP Local time Today, 12:04 Joined Aug 11, 2003 Messages 11,685 Aug 10, 2015 #2 Well first off, why use a DLookup, in 99% of all cases they are overused ... What have you tried to do that didnt work?
Well first off, why use a DLookup, in 99% of all cases they are overused ... What have you tried to do that didnt work?
O ootkhopdi Registered User. Local time Today, 16:34 Joined Oct 17, 2013 Messages 181 Aug 10, 2015 #3 i want to find a value from table on creteria creteria 1= text, creteria 2= year or number and creteria 3 = text pls give me solution
i want to find a value from table on creteria creteria 1= text, creteria 2= year or number and creteria 3 = text pls give me solution
N namliam The Mailman - AWF VIP Local time Today, 12:04 Joined Aug 11, 2003 Messages 11,685 Aug 10, 2015 #4 namliam said: Well first off, why use a DLookup, in 99% of all cases they are overused ... What have you tried to do that didnt work? Click to expand... Well first off, why use a DLookup, in 99% of all cases they are overused ... What have you tried to do that didnt work? Seriously, Dlookups are not great to use overall... particularly if you use more than one..... Anyways the criteria is a single string, so you have to write it like you would SQL Code: "Field1 = 'SomeText' and Field2 = 2015 and field3 = #15/08/2015#" Or if you want to substitute in variables. Code: "Field1 = '" & SomeVar &"' and Field2 = " & Var2 &" and field3 = #" &Format(Vardate, "MM/DD/YYYY") & "#"
namliam said: Well first off, why use a DLookup, in 99% of all cases they are overused ... What have you tried to do that didnt work? Click to expand... Well first off, why use a DLookup, in 99% of all cases they are overused ... What have you tried to do that didnt work? Seriously, Dlookups are not great to use overall... particularly if you use more than one..... Anyways the criteria is a single string, so you have to write it like you would SQL Code: "Field1 = 'SomeText' and Field2 = 2015 and field3 = #15/08/2015#" Or if you want to substitute in variables. Code: "Field1 = '" & SomeVar &"' and Field2 = " & Var2 &" and field3 = #" &Format(Vardate, "MM/DD/YYYY") & "#"
O ootkhopdi Registered User. Local time Today, 16:34 Joined Oct 17, 2013 Messages 181 Aug 11, 2015 #5 i dont understand it pls give me code as Me.Text6 = DLookup("[" & Me.Combo2 & "]", "SalaryRural2009toUpdate", "Empid='" & Me.Combo0 & "' and salmonth= "& feb & " and salyear="&2015") it says >syntax error what is the error pls tell me and how can i solve it
i dont understand it pls give me code as Me.Text6 = DLookup("[" & Me.Combo2 & "]", "SalaryRural2009toUpdate", "Empid='" & Me.Combo0 & "' and salmonth= "& feb & " and salyear="&2015") it says >syntax error what is the error pls tell me and how can i solve it
arnelgp ..forever waiting... waiting for jellybean! Local time Today, 19:04 Joined May 7, 2009 Messages 20,708 Aug 11, 2015 #6 please see this Dlookup syntax: https://msdn.microsoft.com/en-us/library/bb148913(v=office.12).aspx
N namliam The Mailman - AWF VIP Local time Today, 12:04 Joined Aug 11, 2003 Messages 11,685 Aug 12, 2015 #7 ootkhopdi said: what is the error pls tell me and how can i solve it Click to expand... Well for starters you have a quote to many at the end.... also depending on, but I will assume feb and 2015 are constants.... That would make it be something like: Code: "Empid='" & Me.Combo0 & "' and salmonth= 'feb' and salyear=2015"
ootkhopdi said: what is the error pls tell me and how can i solve it Click to expand... Well for starters you have a quote to many at the end.... also depending on, but I will assume feb and 2015 are constants.... That would make it be something like: Code: "Empid='" & Me.Combo0 & "' and salmonth= 'feb' and salyear=2015"
O ootkhopdi Registered User. Local time Today, 16:34 Joined Oct 17, 2013 Messages 181 Aug 13, 2015 #8 it is not working it shows #Error i placed 1 creteria as combo box value and second is name of month and third is year as 1st creteria is combo0 2nd is "feb" 3rd is "2015" how can i concatenate all of these creterias pls help me
it is not working it shows #Error i placed 1 creteria as combo box value and second is name of month and third is year as 1st creteria is combo0 2nd is "feb" 3rd is "2015" how can i concatenate all of these creterias pls help me
N namliam The Mailman - AWF VIP Local time Today, 12:04 Joined Aug 11, 2003 Messages 11,685 Aug 13, 2015 #9 Is EmpID by chance a number field? Code: DLookup("[" & Me.Combo2 & "]", "SalaryRural2009toUpdate","Empid=" & Me.Combo0 & " and salmonth= 'feb' and salyear=2015" This assumes EmpID is a number dield SalMonth is a text field salyear is a number field
Is EmpID by chance a number field? Code: DLookup("[" & Me.Combo2 & "]", "SalaryRural2009toUpdate","Empid=" & Me.Combo0 & " and salmonth= 'feb' and salyear=2015" This assumes EmpID is a number dield SalMonth is a text field salyear is a number field
O ootkhopdi Registered User. Local time Today, 16:34 Joined Oct 17, 2013 Messages 181 Aug 14, 2015 #10 thanks empid is text field feb is text field can i replace 2015 as Lebal caption value is yes how can
thanks empid is text field feb is text field can i replace 2015 as Lebal caption value is yes how can
N namliam The Mailman - AWF VIP Local time Today, 12:04 Joined Aug 11, 2003 Messages 11,685 Aug 14, 2015 #11 same way you are doing with combo0