Re: DLookup

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Where are you getting the value for D? Is that the name of a control on
your form?

Is "D" blank (null)?

Are you sure that C and D are both text? What happens if you drop the quote
marks around D?



"Claes D" <ClaesD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5990E223-9C11-4448-9A9F-64ADE9D7A69D@xxxxxxxxxxxxxxxx
Can anyone see what I´m doing wrong here?

I created a textfield in a form.
Then I have tried some different codes for the field.

=DLookup("[A]";"[B]";"[C]=[D]")
This returns the first record in table B.

=DLookup("[A]";"[B]";"[C] = '" & [D] & "'")
This returns the error data type mismatch.

They are all textfields, and I have tried different ways.
Cant get it to work.

I have used DLookup several times before, and it has always worked before.

I´m no expert in any way, so pls be nice to me. :)

/Claes









.



Relevant Pages

  • Re: open a form through a subform in access 2000
    ... The DLookup function should work (the name error you're getting is because ... have a control and a field named the same but the control is not bound to ... subform - names, what fields the controls are bound to, etc.? ... > Still cant get it to work, maybe I cant use DlookUp and need to see about ...
    (microsoft.public.access.reports)
  • Re: DLookup
    ... And that returns the value of A in first record in Table B? ... I created a textfield in a form. ... Cant get it to work. ... I have used DLookup several times before, ...
    (microsoft.public.access.queries)
  • Re: forms!formname!field vs. me.fieldname
    ... >>> <<You must use the first syntax whenever textfield is not in ... >> Bottom line is that if a bound control and a record source ... it doesn't effect the underlying record set. ... >>>> the form and if there is no control named textfield, ...
    (microsoft.public.access.formscoding)
  • Re: strange behaviour button that opens zoombox
    ... Detail section to force the focus to move to another control. ... textfield, and in the onclick event I have the code ... RunCommand acCmdZoomBox ... When I close this zoombox, *all* the buttons next to all the textfields ...
    (microsoft.public.access.formscoding)
  • Re: Cant change label header with OnOpen
    ... Run the code in the On Format event of the section containing the control. ... I am using a generic report, of which I need to change the header on ... I don't mind if the header text is in a label of a textfield. ...
    (microsoft.public.access.reports)