Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax in macro condition

Status
Not open for further replies.

cafulford

MIS
Oct 14, 2009
30
US
Hi, I am using the following condition that works fine:

DCount("*","BL_FILE2","[deliv_num]=Forms![do a delivery]![deliv_num]")>0

in a macro that looks to see if there are multiple pages of this particular form called "do a delivery" based on "deliv_num" in the file "BL_FILE2". The form "do a deliver" is open at the time this macro is run.

What I need to do and am not sure what the syntax would be is to change the above to look up to see is a particular page # exists, not just if there is more than 1 page. For example, how would I look up the record for page #2? In "BL_FILE2", I have a key for "deliv_num" and "page_no".

Thanks!
 
Something like this ?
DCount("*","BL_FILE2","deliv_num=Forms![do a delivery]!deliv_num AND page_no=2")>0

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for the input. I ended up getting it to work as follows in case someone else is looking for something similar:

nz(DLookUp("page_no","BL_File2","deliv_num=[Forms]![do a delivery]![deliv_num]")="2")


nz(DLookUp("page_no","BL_File2","deliv_num=[Forms]![do a delivery]![deliv_num]")="3")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top