Open Report -->working not correctly

Janjang

Registered User.
Local time
Tomorrow, 04:52
Joined
Oct 17, 2005
Messages
80
hi...
firstly, i created some report based on query. then in my form i create list and combox to list down all primary key that had in query..
what i want to do is open report, based on criteria that i selected from combobox or list box...
i create both cbo and list box to compare which 1 is better... but both not working. i mean it works but not show the data as i want to. it open / list all data at report..

i use this code but nothing happen :

for listbox;
StCriteria = "[ID]=" & "'" & ListCustomer.Column(0) & "'"
DoCmd.OpenReport "Invoice Print", acPreview, , StrCriteria

and Cbo;
StrCriteria = "[ID]=" & Me.[cboCustomer]
DoCmd.OpenReport "Invoice Print", acPreview, , StrCriteria


plz help me..i dunno what to do.. :confused:
it works but not correct
 
Pass the value from the combo box to the query that the report uses
forms![yourform]![combobox] (in the criteria section of the query under the column you require.
create a button on the form that when clicked will run the report

Hope this helps
 
pop-up box apear wit blank box, show Form!MainForm!cboCustomer then below it empty box..

am i need to insert Tab name if i use Tab at MainForm?like this
Form!MainForm![Tab]!cboCustomer ?
 

Users who are viewing this thread

Back
Top Bottom