Re: Dlookup run time error 2001
From: Mike (Mike_at_discussions.microsoft.com)
Date: 11/24/04
- Next message: Slow Learner: "Open a Word Document from a command Button"
- Previous message: Alex Ivanov: "Re: query mdb on network into Word. Access.exe not on workstation"
- In reply to: Allen Browne: "Re: Dlookup run time error 2001"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Nov 2004 13:25:08 -0800
Thank you, field is text, and the qoutation marks worked
"Allen Browne" wrote:
> The error indicates that one of the 3 arguments for DLookup() is not
> correct.
>
> If init is a Number type field (not a Text type field), try:
> Dim strWhere As String
> Dim blp as Variant
> strWhere = "[init] =" & forms![anyform]![field]
> blp = DLookup("[specialty]", "operators", strWhere)
>
> If it is a Text type field, you need extra quotes:
> strWhere = "[init] =""" & forms![anyform]![field] & """"
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Mike" <Mike@discussions.microsoft.com> wrote in message
> news:1CB53026-02AA-4A10-919F-CA028AA50157@microsoft.com...
> >I continually get the message "you have cancelled the previous operation"
> >run
> > time error 2001 when I use the following dlookup function
> >
> > dim blp as string
> > blp = dlookup("[specialty]","operators","[init]
> > ="&forms![anyform]![field]"
> >
> > I have evencreated a new unbound form with no other code and still receive
> > this message.
> >
> > Any help appreciated
> > --
> > Mike
>
>
>
- Next message: Slow Learner: "Open a Word Document from a command Button"
- Previous message: Alex Ivanov: "Re: query mdb on network into Word. Access.exe not on workstation"
- In reply to: Allen Browne: "Re: Dlookup run time error 2001"
- Messages sorted by: [ date ] [ thread ]