dlookup

  • Thread starter laveshhp via AccessMonster.com
  • Start date
L

laveshhp via AccessMonster.com

Hi!

Please help me

i need data from my query for beginning date which i use in date form range
and i use below but show me #error

=DLookUp("[Balance]","Table1 Query",[Forms]![Date3]!Format([BeginningDate],
"#"))

thanks
 
E

Eric Heinold

Not sure what you are are doing with the 3rd part of the statement, but it
looks like you have some things wrong there:
[Forms]![Date3]!Format([BeginningDate],"#")

This is usually in the form of :
[Query Field Name] = Expression

Example:

"StartDate = " & Forms!Date3!BeginningDate

StartDate would be the name of the field in the query, change this if it
is different.
Often to make Dlookup recognize a date, I put # at the start and end of
the date:

"BeginningDate = #" & Forms!Date3!BeginningDate & "#"
 
L

laveshhp via AccessMonster.com

Eric said:
Not sure what you are are doing with the 3rd part of the statement, but it
looks like you have some things wrong there:
[Forms]![Date3]!Format([BeginningDate],"#")

This is usually in the form of :
[Query Field Name] = Expression

Example:

"StartDate = " & Forms!Date3!BeginningDate

StartDate would be the name of the field in the query, change this if it
is different.
Often to make Dlookup recognize a date, I put # at the start and end of
the date:

"BeginningDate = #" & Forms!Date3!BeginningDate & "#"
[quoted text clipped - 9 lines]

Hi! Eric
Thanks for quick reply but i am new in access so can you provide me all
formula

date is my query field and i need data only for my beginning date which i put
in date3 form

thanks for your help
 
E

Eric Heinold

=DLookUp("[Balance]","Table1 Query","Date=[Forms]![Date3]![BeginningDate]")

After looking at the query again and your question again, I think this is
how you will need structure it. I usually use Dlookup in code, so I would
to it the way I noted below, but for a control source, I think this will
work for you.
laveshhp via AccessMonster.com said:
Eric said:
Not sure what you are are doing with the 3rd part of the statement, but it
looks like you have some things wrong there:
[Forms]![Date3]!Format([BeginningDate],"#")

This is usually in the form of :
[Query Field Name] = Expression

Example:

"StartDate = " & Forms!Date3!BeginningDate

StartDate would be the name of the field in the query, change this if
it
is different.
Often to make Dlookup recognize a date, I put # at the start and end
of
the date:

"BeginningDate = #" & Forms!Date3!BeginningDate & "#"
[quoted text clipped - 9 lines]

Hi! Eric
Thanks for quick reply but i am new in access so can you provide me all
formula

date is my query field and i need data only for my beginning date which i
put
in date3 form

thanks for your help
 
L

laveshhp via AccessMonster.com

Eric said:
=DLookUp("[Balance]","Table1 Query","Date=[Forms]![Date3]![BeginningDate]")

After looking at the query again and your question again, I think this is
how you will need structure it. I usually use Dlookup in code, so I would
to it the way I noted below, but for a control source, I think this will
work for you.[quoted text clipped - 31 lines]
thanks for your help
Hi!

Still didn't work now i ger #error message

thanks for your help
 
D

Douglas J. Steele

Since there's a space in Table1 Query, it needs to be enclosed in square
brackets. You should also take the reference to the form field out of the
quotes, make sure it's delimited with #, and that it's in mm/dd/yyyy format
(regardless of what your Regional Settings might be). Finally, Date is a
reserved word, and shouldn't be used for your own purposes. If you cannot
(or will not) change the name, at least use square brackets around it:

=DLookUp("[Balance]","[Table1 Query]","[Date]=" &
Format([Forms]![Date3]![BeginningDate], "\#mm\/dd\/yyyy\#"))


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


laveshhp via AccessMonster.com said:
Eric said:
=DLookUp("[Balance]","Table1
Query","Date=[Forms]![Date3]![BeginningDate]")

After looking at the query again and your question again, I think this is
how you will need structure it. I usually use Dlookup in code, so I would
to it the way I noted below, but for a control source, I think this will
work for you.
Not sure what you are are doing with the 3rd part of the statement, but
it
looks like you have some things wrong there:
[quoted text clipped - 31 lines]
thanks for your help
Hi!

Still didn't work now i ger #error message

thanks for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top