Reports from form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a employee database, I use the form to add data to this database, In
the form I have a combo box. I use this combo box to to revisit the data I
have entered. I also have a report for each employee in database (200
pages). I have a command button in my form called "preview report" when I
click this button it takes me to a report of all 200 employee starting from
page one. Actually I wanted this command button to take me only to that page
whose name appears in the form. Any help are highly appreciated

Some of the fields available in my database are: Name, Id number, address,
tel no, etc etc
 
Hello,

I have a employee database, I use the form to add data to this database, In
the form I have a combo box. I use this combo box to to revisit the data I
have entered. I also have a report for each employee in database (200
pages). I have a command button in my form called "preview report" when I
click this button it takes me to a report of all 200 employee starting from
page one. Actually I wanted this command button to take me only to that page
whose name appears in the form. Any help are highly appreciated

Some of the fields available in my database are: Name, Id number, address,
tel no, etc etc

Code the command button click event:
DoCmd.OpenReport "ReportName",acViewPreview, , "[IDNumber] = " &
Me![IDNumber]

The above assumes IDNumber is a Number datatype, and is the Prime Key
field for this table.
If it is text datatype then use:

"[IDNumber] = '" & Me![IDNumber] & "'"
 
Thanks, it was useful

fredg said:
Hello,

I have a employee database, I use the form to add data to this database, In
the form I have a combo box. I use this combo box to to revisit the data I
have entered. I also have a report for each employee in database (200
pages). I have a command button in my form called "preview report" when I
click this button it takes me to a report of all 200 employee starting from
page one. Actually I wanted this command button to take me only to that page
whose name appears in the form. Any help are highly appreciated

Some of the fields available in my database are: Name, Id number, address,
tel no, etc etc

Code the command button click event:
DoCmd.OpenReport "ReportName",acViewPreview, , "[IDNumber] = " &
Me![IDNumber]

The above assumes IDNumber is a Number datatype, and is the Prime Key
field for this table.
If it is text datatype then use:

"[IDNumber] = '" & Me![IDNumber] & "'"
 
Back
Top