Command Button with datasheet view

B

Bretona10

I have a form with a subform, both default to datasheet views. I want to put
a Print Preview button on the form, but it doesnt show up in the datasheet
view.

Is there a way to do this?

Thanks,
Bret
 
F

fredg

I have a form with a subform, both default to datasheet views. I want to put
a Print Preview button on the form, but it doesnt show up in the datasheet
view.

Is there a way to do this?

Thanks,
Bret

Forms are not designed for printing. Reports are.
Create a report that displays the data the way you want it to.
Then open the report from the command button on your form.
DoCmd.OpenReport "ReportName", acPreview
will display all the records.

If you wish to just report on the one record displayed on the form,
add a where clause to the above OpenReport code.

Assuming the Unique Field is a Number datatype, then:
DoCmd.OpenReport "ReportName", acPreview , , "[RecordID] = " &
Me.[RecordID]

However, if the Unique Field is a Text datatype, use:
DoCmd.OpenReport "ReportName", acPreview , , "[RecordID] = '" &
Me.[RecordID] & "'"
 
G

Gina Whipp

Bretona10,

That would be one of the pitfalls of using datasheet view. Perhaps creating
a form that *loks like* datasheet view, then you could use a button.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I have a form with a subform, both default to datasheet views. I want to put
a Print Preview button on the form, but it doesnt show up in the datasheet
view.

Is there a way to do this?

Thanks,
Bret
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top