Excel

  • Thread starter Thread starter Froto
  • Start date Start date
F

Froto

I have a command button on my form with the following code

DoCmd.OutputTo acQuery, "Analysis Query",
acFormatXLS, "\\Bulldog\Admin\Copy of analytical Forms
Database\Form.xls", -1

End Sub

How do I change the code above to only export only the
record that's open and not all the records in the database

Thanks much for all the HELP
 
-----Original Message-----
I have a command button on my form with the following code

DoCmd.OutputTo acQuery, "Analysis Query",
acFormatXLS, "\\Bulldog\Admin\Copy of analytical Forms
Database\Form.xls", -1

End Sub

How do I change the code above to only export only the
record that's open and not all the records in the database

Thanks much for all the HELP
.
Hi Froto,
put criteria in your query that references the current
record.
In criteria row for PrimaryKey field use following as an
example
forms![export to excel form name]![PrimaryKeyFieldName]

Luck
Jonathan
 
Back
Top