A
Aamer
I have No idea why this code is still not working.
let me explain what I did
1. Created a popup form "Dialog General Purchase"
2. Placed a List Box which collects the Company Names from "General Purchase
Detail Querry" The feild for Company name is "Pur CompanyName" Grouped them
so they are not duplicated.
3. Placed a Button on the "Dialog General Purchase" Form
4. in the properties of the button on clik i cliked on CODE BUILDER and
entered the following code.
DoCmd.OpenReport "General Purchase Detail", , , "[pur companyname] = """ _
& Me.[lstpur companyname] & """"
after i do the above it still gives me error.
let me explain what I did
1. Created a popup form "Dialog General Purchase"
2. Placed a List Box which collects the Company Names from "General Purchase
Detail Querry" The feild for Company name is "Pur CompanyName" Grouped them
so they are not duplicated.
3. Placed a Button on the "Dialog General Purchase" Form
4. in the properties of the button on clik i cliked on CODE BUILDER and
entered the following code.
DoCmd.OpenReport "General Purchase Detail", , , "[pur companyname] = """ _
& Me.[lstpur companyname] & """"
after i do the above it still gives me error.
John W. Vinson said:it did not work
I am selecting company name field name is "pur companyname"
no its not looking with customer id
report name is "General Purchase"
I have tried the following:
DoCmd.OpenReport "General Purchase", , , "pur companyname = " & Me.lstpur
companyname
but its not woking.
can you pls fix it.
Two problems that I see: for one, you (unwisely) used a blank in the
fieldname. If you use blanks or other special characters in fieldnames you
must enclose the fieldname in square brackets. In addition, if you're
searching for a text company name, you must include the syntactically required
quotemarks. Since a company name might contain an apostrophe (Joe's Diner for
example) you must delimit with doublequotes; to include a doublequote in a
string delimited with doublequotes, you must use TWO doublequotes. Try
DoCmd.OpenReport "General Purchase", , , "[pur companyname] = """ _
& Me.[lstpur companyname] & """"