MS Access DLOOKUP with text and nested DLOOKUP for criteria -


I have a combobox that contains search terms that the user chooses a search term and it appears to the table containing the number X . The RVU (one number) X of the X equal to the 'PHYS' string of the square is seen in the second table. I was using the nested DLOOKUP statement to see the number x and then using that number, x and string parameters to RVU Was done to see. Here is my code:

  FH_array (0) = Val (NZ (DLookup ("[RVU]", "supports [IR Pikar]", "[IP] =" & "DLookup" ("[FORES]", "[IP number Xwalk]", "[name of reference] = '" and .rh_name and "'"), 0))))), "")  

I was not destined, so I broke it down to debug it:

  a = val (NZ (DLookup ("[FORES]" , "[IP number Xwalk]", "[name of reference] = '' & amp; Me.Ref_Name & amp;; ''), 0)) debug. Print" a: "; A return value of 279 AA = Val (NX (DLUQUP ("[RUVU]", "[FOE IP Picker]", " [IIP] = "and A and" and "[class of cost] = 'PHYS'))) debug. Print" AA: "AA  

I have a syntax on line for variable AA I am getting the error. If I

  AA = DLQP ("[RUV]", "[IR peer] [Force IP picker]", "[IP] =" And A and "And [Cost class] = 'PHYS')  

  aa = DLookup ("[RVU]", "[FORES IP picker]", "[cost Class] = 'PHYS' "and" [IP] = "& amp; A)  

I get a run-time error of type 13 mismatch

all Ghosh Ghosh as version Be used and it is called properly. The array FH_array is the correct size I have copied this code from another database which is similar to the nested DLUKUP, but it only has one parameter and therefore works. I can not understand what I am missing syntax or how to do mismatched work in it.

You need a single valid string as the DLookup criteria option Use the instant window to find out what you have for the criteria in the last DLookup example.

  debug Print "[cost class] = 'PHYS'" and "[ip] =" & amp; A  

This is actually a "logical connection" of two stars (if you review the access help topic for and operator Then it will be more understandable.)

And since you are using and with two strings, the expression complains about the access type mismatch, As it does with this simple example:

  debug Print "a" and "b"  

So you need to create a single valid string for the criteria choice ...

  a = 279 debug print" [cost class] = 'PHYS' and [IP] = "& amp; A [cost class] = 'PHYS' and [IP] = 279  

translating back to the last DLookup in your question ...

string StrCriteria = "[class of cost] = 'PHYS' and [IP] =" & amp; Amp; A debug.print moderate '& lt; - To ensure that you need AA = DLookup ("[RVU]", "[IR Peer [Force IP Picker]", strCriteria)

Comments