Re: DLookup Problem




Thanks, that did the trick!


Allen Browne wrote:
> Concatenate the value into the 3rd string in DLookup():
>
> varUP = DLookup("[Max PSI]", "Gauges", "[ind]=" & [varIND])
>
> For further explanation, see:
> Getting a value from a table: DLookup()
> at:
> http://allenbrowne.com/casu-07.html
>
> --
> 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.
>
> <g.ormesher@xxxxxxxxxxxx> wrote in message
> news:1124957229.853191.251030@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> >
> > Hi, my primary key is a field called "ind"
> >
> >
> > 'Code
> >
> > Dim varUP as Varient
> > Dim varIND as Interger
> >
> > varIND = Me.ind ' this sets varIND to the index value
> >
> > varUP = DLookup("[Max PSI]", "Gauges", "[ind]=[varIND]")
> >
> > The above fails with an run time error '2001'
> >
> > 'if I change the line to
> >
> > varUP = DLookup("[Max PSI]", "Gauges", "[ind]=1")
> >
> > It picks up the value
> >
> > I'm doing something wrong with the formating of the code.
> > Can anyone help.
> >
> > Thanks
> >
> > Geoff

.



Relevant Pages

  • Re: How to get elapsed time?
    ... What I want is for the DLookUp to find the "Out ... > Allen Browne - Microsoft MVP. ... rather than allenbrowne at mvps dot org. ...
    (microsoft.public.access.queries)
  • Re: DLookup Date Syntax
    ... > For an explanation, see: ... > Getting a value from a table: DLookup() ... > Allen Browne - Microsoft MVP. ... rather than allenbrowne at mvps dot org. ...
    (microsoft.public.access.reports)
  • Re: Before Update
    ... >Use DLookup() to see if the value is already there. ... >Allen Browne - Microsoft MVP. ... rather than allenbrowne at mvps dot org. ... >> add a BeforeUpdate statement that verifies if it ...
    (microsoft.public.access.formscoding)
  • Re: Getting info from records in a Table
    ... > Getting a value from a table: DLookup() ... > Allen Browne - Microsoft MVP. ... rather than allenbrowne at mvps dot org. ... >> How do I get the price values into the form? ...
    (microsoft.public.access.formscoding)
  • Re: Try to code a Command Button "Clear List"
    ... > Dim varItem As Variant ... > Allen Browne - Microsoft MVP. ... rather than allenbrowne at mvps dot org. ...
    (microsoft.public.access.formscoding)