creating forms?

G

Guest

I am very new to access. I'm trying to creat a form by using autoform. The
problem that I'm having is my fields in my table are to long. I need
everything that I put in my table. The form is wider then my paper. It is
fine for the form to be more then one page but everything isn't on the page
because it is to wide. How do I change this. I used columnar also but that
didn't help. Thank you in advanced.
 
D

Duane Hookom

View your form in design view and move and resize controls to get the exact
layout you want.
 
R

Rick B

You mention forms and paper in this post. Forms (in Access) are interactive
object to view, edit and add data. If you are trying to print something,
you should be creating a report, not a form. A report can be used to print
one record, or many records. You can control the layout and format of each
object in the report. Filters and queries can be used to control which
records print.

You can add a button to your form that says something like "print this
customer" that will cause the associated report to be sent to the printer.
If you need sample code for this, either search previous posts, or send a
message back and I would be happy to include some sample code.

In short, forms are not designed for printing, reports are.
 
G

Guest

Thank you! If you could send me some sample codes that would be great. I
also need to put a drop down box so you can choose different people in the
drop down. How do I do this? Thanks again.
 
R

Rick B

The code I used assumes that you are looking at the appropriate record
before you click the button, so there is no need for the drop-down you
mention. If you try to click the button when there is no record displayed,
an error message will tell you to find a record first.

Here's the code to tie to your button. There are also a few links that may
help.

Good luck!
--
Rick B


Button to print specific record
Private Sub cmdPrint_Click()

Dim strWhere As String

If Me.Dirty Then 'Save any edits.

Me.Dirty = False

End If

If Me.NewRecord Then 'Check there is a record to print

MsgBox "Select a record to print"

Else

strWhere = "[ID] = " & Me.[ID]

DoCmd.OpenReport "MyReport", acViewPreview, , strWhere

End If

End Sub



Notes: If your primary key is a Text type field (not a Number type field),
you need extra quotes: strWhere = "[ID] = """ & Me.[ID] & """"

If you want the report to print without preview, replace acViewPreview with
acViewNormal.



See also: http://allenbrowne.com/casu-15.html

See also: http://www.databasedev.co.uk/print_form_record.html
 

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

Similar Threads

#Name? error on form 9
acnewrec? 1
Extra pages in report -- elements too wide? 3
Switchboard & Forms 5
Help - creating forms 2
Creating Forms 5
Access Access - Is it possible to repeat fields in a form? 1
Autoform:Columnar 2

Top