I AM SO DUMB..........................PLEASE HELP

G

Guest

I am very new to Access and have been working forever to try to get a simple form together for my boss. It's a form which tracks incoming work orders on vehicles complete with a work order number, date incoming, date expected back, date sent out for service, where and a few other items. At the bottom of the form I want a command button that reads print form which would print only one form. I have read tons of information concerning not printing forms but rather to set up a report and print that instead. I have also read alot about VBA's (very confusing information-to me) Printing a report is fine with me - I have set one up that looks beautiful, now my biggest dilema. I need step-by-step instructions (remember I'm really dumb) on how to link the command button on the form to the report. Also, I'm sure you've figured out I need to print one form or report at time. You have no idea how much I would appreciate any help given.
 
C

Cheryl Fischer

You will need to add a Where Condition to the OpenReport method so that the
report shows only the information for the record displayed on your form. The
record will need to have a unique identifier, presumably WorkOrderNumber.
Then, in the Click event of your command button, you can insert the
following:

' This works when your WorkOrderNumber field is text

Dim strCriteria As String

strCriteria = "[WorkOrderNumber] = " & Chr(34) & Me!WorkOrderNumber &
Chr(34)
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

' This works when your WorkOrderNumber field is a number

Dim strCriteria As String

strCriteria = "[WorkOrderNumber] = " & Me!WorkOrderNumber
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

In the event that you have not done much VBA coding of events, here are the
steps needed to put the code "behind a button":

1. Right click on the desired Command Button (let's call it:
CommandRunReport) control and select Properties.

2. When the Properties sheet opens, click the tab labeled Event.

3. In the grid below, locate the row labeled, On Click. It should be blank.
Click anywhere in the white space to the right of the label and you will see
a downward-pointing arrow appear, indicating that this is also a ComboBox.
Click the arrow and select "Event Procedure".

4. Then, notice that there is an ellipsis or three little dots (...) to the
right of the ComboBox. Click the ellipsis and you will open a code window.
You will see that Access has given you a space for entering some code in
this event - it will look something like the following:

Private Sub Private Sub CommandRunReport_Click()

End Sub

5. After the "Private Sub Private Sub CommandRunReport_Click()" line,
insert the code provided earlier.

6. Click the Save icon and close the Microsoft Visual Basic code window.




--

Cheryl Fischer, MVP Microsoft Access



kdc said:
I am very new to Access and have been working forever to try to get a
simple form together for my boss. It's a form which tracks incoming work
orders on vehicles complete with a work order number, date incoming, date
expected back, date sent out for service, where and a few other items. At
the bottom of the form I want a command button that reads print form which
would print only one form. I have read tons of information concerning not
printing forms but rather to set up a report and print that instead. I have
also read alot about VBA's (very confusing information-to me) Printing a
report is fine with me - I have set one up that looks beautiful, now my
biggest dilema. I need step-by-step instructions (remember I'm really dumb)
on how to link the command button on the form to the report. Also, I'm sure
you've figured out I need to print one form or report at time. You have no
idea how much I would appreciate any help given.
 
L

LMB

Hi Cheryl,

Since I am not a programmer, I use the toolbox and click on the command
button. I then follow the prompts and there is one for report operations.
I have used 2 before, the print report and open report. What is the
advantage to doing it using the method below instead of the toolbox? I
would never be able to remember all of that wording. Does using the wizards
cause the database to have problems or not to be efficient? BTW, I go the
book "Database design for mere mortals SE" that you suggested in another
thread. It cost me $50 at the local bookstore but I just couldn't wait to
have it delivered <g> So far I am understanding it, I have read the intro.
<s>

Thanks,
Linda


Cheryl Fischer said:
You will need to add a Where Condition to the OpenReport method so that the
report shows only the information for the record displayed on your form. The
record will need to have a unique identifier, presumably WorkOrderNumber.
Then, in the Click event of your command button, you can insert the
following:

' This works when your WorkOrderNumber field is text

Dim strCriteria As String

strCriteria = "[WorkOrderNumber] = " & Chr(34) & Me!WorkOrderNumber &
Chr(34)
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

' This works when your WorkOrderNumber field is a number

Dim strCriteria As String

strCriteria = "[WorkOrderNumber] = " & Me!WorkOrderNumber
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

In the event that you have not done much VBA coding of events, here are the
steps needed to put the code "behind a button":

1. Right click on the desired Command Button (let's call it:
CommandRunReport) control and select Properties.

2. When the Properties sheet opens, click the tab labeled Event.

3. In the grid below, locate the row labeled, On Click. It should be blank.
Click anywhere in the white space to the right of the label and you will see
a downward-pointing arrow appear, indicating that this is also a ComboBox.
Click the arrow and select "Event Procedure".

4. Then, notice that there is an ellipsis or three little dots (...) to the
right of the ComboBox. Click the ellipsis and you will open a code window.
You will see that Access has given you a space for entering some code in
this event - it will look something like the following:

Private Sub Private Sub CommandRunReport_Click()

End Sub

5. After the "Private Sub Private Sub CommandRunReport_Click()" line,
insert the code provided earlier.

6. Click the Save icon and close the Microsoft Visual Basic code window.




--

Cheryl Fischer, MVP Microsoft Access



kdc said:
I am very new to Access and have been working forever to try to get a
simple form together for my boss. It's a form which tracks incoming work
orders on vehicles complete with a work order number, date incoming, date
expected back, date sent out for service, where and a few other items. At
the bottom of the form I want a command button that reads print form which
would print only one form. I have read tons of information concerning not
printing forms but rather to set up a report and print that instead. I have
also read alot about VBA's (very confusing information-to me) Printing a
report is fine with me - I have set one up that looks beautiful, now my
biggest dilema. I need step-by-step instructions (remember I'm really dumb)
on how to link the command button on the form to the report. Also, I'm sure
you've figured out I need to print one form or report at time. You have no
idea how much I would appreciate any help given.
 
S

Steve

The first time is always the hardest! Contact me if you would like help creating
your database. You could then use the database as a model for creating future
databases.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



kdc said:
I am very new to Access and have been working forever to try to get a simple
form together for my boss. It's a form which tracks incoming work orders on
vehicles complete with a work order number, date incoming, date expected back,
date sent out for service, where and a few other items. At the bottom of the
form I want a command button that reads print form which would print only one
form. I have read tons of information concerning not printing forms but rather
to set up a report and print that instead. I have also read alot about VBA's
(very confusing information-to me) Printing a report is fine with me - I have
set one up that looks beautiful, now my biggest dilema. I need step-by-step
instructions (remember I'm really dumb) on how to link the command button on the
form to the report. Also, I'm sure you've figured out I need to print one form
or report at time. You have no idea how much I would appreciate any help
given.
 
C

Cheryl Fischer

Since I am not a programmer, I use the toolbox and click on the command
button. I then follow the prompts and there is one for report operations.
I have used 2 before, the print report and open report. What is the
advantage to doing it using the method below instead of the toolbox?

You indicated you wanted a way to print a report for just the current record
on your form. The Report Wizard, as you've probably noticed, does give you
the option to Preview or Print your report, but it does not give you an
option to "print only current record". That code expands on the arguments
available to DoCmd.OpenReport by adding a temporary WHERE clause specifying
which record to include in the report, as opposed to simply printing all
records. (You can check out these additional arguments by opening VBA Help
and searching in the Answer Wizard on: OpenReport
I would never be able to remember all of that wording.

Well, you don't really need to remember all that wording; just copy the
appropriate lines of code (depending on whether your key field is text or
numeric) into the click event of the button you want to use to create a
report for the individual record.
Does using the wizards cause the database to have problems or not to be
efficient?

Not as far as I know. You need to be aware that the Wizards are intended
to simplify the more commonly-used actions in Access; they are not intended
to provide you with options for *all* of the available functionality.
Often, using Wizards to generate a bit of code can be a help in learning
VBA. For example, when I first started teaching myself Access, I'd use a
Wizard to create a command button to open a form. Then, I'd open the code,
click on OpenForm and press the F1 key to see what else was there.
BTW, I go the book "Database design for mere mortals"

Great! You won't regret it.

--

Cheryl Fischer, MVP Microsoft Access



LMB said:
Hi Cheryl,
I
would never be able to remember all of that wording. Does using the
wizards
SE" that you suggested in another
thread. It cost me $50 at the local bookstore but I just couldn't wait to
have it delivered <g> So far I am understanding it, I have read the intro.
<s>

Thanks,
Linda


Cheryl Fischer said:
You will need to add a Where Condition to the OpenReport method so that the
report shows only the information for the record displayed on your form. The
record will need to have a unique identifier, presumably WorkOrderNumber.
Then, in the Click event of your command button, you can insert the
following:

' This works when your WorkOrderNumber field is text

Dim strCriteria As String

strCriteria = "[WorkOrderNumber] = " & Chr(34) & Me!WorkOrderNumber &
Chr(34)
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

' This works when your WorkOrderNumber field is a number

Dim strCriteria As String

strCriteria = "[WorkOrderNumber] = " & Me!WorkOrderNumber
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

In the event that you have not done much VBA coding of events, here are the
steps needed to put the code "behind a button":

1. Right click on the desired Command Button (let's call it:
CommandRunReport) control and select Properties.

2. When the Properties sheet opens, click the tab labeled Event.

3. In the grid below, locate the row labeled, On Click. It should be blank.
Click anywhere in the white space to the right of the label and you will see
a downward-pointing arrow appear, indicating that this is also a ComboBox.
Click the arrow and select "Event Procedure".

4. Then, notice that there is an ellipsis or three little dots (...) to the
right of the ComboBox. Click the ellipsis and you will open a code window.
You will see that Access has given you a space for entering some code in
this event - it will look something like the following:

Private Sub Private Sub CommandRunReport_Click()

End Sub

5. After the "Private Sub Private Sub CommandRunReport_Click()" line,
insert the code provided earlier.

6. Click the Save icon and close the Microsoft Visual Basic code window.




--

Cheryl Fischer, MVP Microsoft Access



kdc said:
I am very new to Access and have been working forever to try to get a
simple form together for my boss. It's a form which tracks incoming work
orders on vehicles complete with a work order number, date incoming, date
expected back, date sent out for service, where and a few other items. At
the bottom of the form I want a command button that reads print form which
would print only one form. I have read tons of information concerning not
printing forms but rather to set up a report and print that instead. I have
also read alot about VBA's (very confusing information-to me) Printing a
report is fine with me - I have set one up that looks beautiful, now my
biggest dilema. I need step-by-step instructions (remember I'm really dumb)
on how to link the command button on the form to the report. Also, I'm sure
you've figured out I need to print one form or report at time. You
have
no
idea how much I would appreciate any help given.
 
C

Cheryl Fischer

Just one last thing ...

Everyone has to start somewhere, and having one or two good books plus the
desire to learn good techniques and make them your own is getting off to a
*very good start*.

As you work through your book and your database project, do not hesitate to
post here with your questions. There are dozens of Access MVPs and other
expert responders who will be happy to answer them - and, of course, all
help is provided at our low, low rate of zero dollars/hour <smile>.


--

Cheryl Fischer, MVP Microsoft Access



LMB said:
Hi Cheryl,

Since I am not a programmer, I use the toolbox and click on the command
button. I then follow the prompts and there is one for report operations.
I have used 2 before, the print report and open report. What is the
advantage to doing it using the method below instead of the toolbox? I
would never be able to remember all of that wording. Does using the wizards
cause the database to have problems or not to be efficient? BTW, I go the
book "Database design for mere mortals SE" that you suggested in another
thread. It cost me $50 at the local bookstore but I just couldn't wait to
have it delivered <g> So far I am understanding it, I have read the intro.
<s>

Thanks,
Linda


Cheryl Fischer said:
You will need to add a Where Condition to the OpenReport method so that the
report shows only the information for the record displayed on your form. The
record will need to have a unique identifier, presumably WorkOrderNumber.
Then, in the Click event of your command button, you can insert the
following:

' This works when your WorkOrderNumber field is text

Dim strCriteria As String

strCriteria = "[WorkOrderNumber] = " & Chr(34) & Me!WorkOrderNumber &
Chr(34)
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

' This works when your WorkOrderNumber field is a number

Dim strCriteria As String

strCriteria = "[WorkOrderNumber] = " & Me!WorkOrderNumber
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

In the event that you have not done much VBA coding of events, here are the
steps needed to put the code "behind a button":

1. Right click on the desired Command Button (let's call it:
CommandRunReport) control and select Properties.

2. When the Properties sheet opens, click the tab labeled Event.

3. In the grid below, locate the row labeled, On Click. It should be blank.
Click anywhere in the white space to the right of the label and you will see
a downward-pointing arrow appear, indicating that this is also a ComboBox.
Click the arrow and select "Event Procedure".

4. Then, notice that there is an ellipsis or three little dots (...) to the
right of the ComboBox. Click the ellipsis and you will open a code window.
You will see that Access has given you a space for entering some code in
this event - it will look something like the following:

Private Sub Private Sub CommandRunReport_Click()

End Sub

5. After the "Private Sub Private Sub CommandRunReport_Click()" line,
insert the code provided earlier.

6. Click the Save icon and close the Microsoft Visual Basic code window.




--

Cheryl Fischer, MVP Microsoft Access



kdc said:
I am very new to Access and have been working forever to try to get a
simple form together for my boss. It's a form which tracks incoming work
orders on vehicles complete with a work order number, date incoming, date
expected back, date sent out for service, where and a few other items. At
the bottom of the form I want a command button that reads print form which
would print only one form. I have read tons of information concerning not
printing forms but rather to set up a report and print that instead. I have
also read alot about VBA's (very confusing information-to me) Printing a
report is fine with me - I have set one up that looks beautiful, now my
biggest dilema. I need step-by-step instructions (remember I'm really dumb)
on how to link the command button on the form to the report. Also, I'm sure
you've figured out I need to print one form or report at time. You
have
no
idea how much I would appreciate any help given.
 
L

LMB

Thanks

Linda

Cheryl Fischer said:
Just one last thing ...

Everyone has to start somewhere, and having one or two good books plus the
desire to learn good techniques and make them your own is getting off to a
*very good start*.

As you work through your book and your database project, do not hesitate to
post here with your questions. There are dozens of Access MVPs and other
expert responders who will be happy to answer them - and, of course, all
help is provided at our low, low rate of zero dollars/hour <smile>.


--

Cheryl Fischer, MVP Microsoft Access



LMB said:
Hi Cheryl,

Since I am not a programmer, I use the toolbox and click on the command
button. I then follow the prompts and there is one for report operations.
I have used 2 before, the print report and open report. What is the
advantage to doing it using the method below instead of the toolbox? I
would never be able to remember all of that wording. Does using the wizards
cause the database to have problems or not to be efficient? BTW, I go the
book "Database design for mere mortals SE" that you suggested in another
thread. It cost me $50 at the local bookstore but I just couldn't wait to
have it delivered <g> So far I am understanding it, I have read the intro.
<s>

Thanks,
Linda


Cheryl Fischer said:
You will need to add a Where Condition to the OpenReport method so
that
the
report shows only the information for the record displayed on your
form.
The
record will need to have a unique identifier, presumably WorkOrderNumber.
Then, in the Click event of your command button, you can insert the
following:

' This works when your WorkOrderNumber field is text

Dim strCriteria As String

strCriteria = "[WorkOrderNumber] = " & Chr(34) &
Me!WorkOrderNumber
&
Chr(34)
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

' This works when your WorkOrderNumber field is a number

Dim strCriteria As String

strCriteria = "[WorkOrderNumber] = " & Me!WorkOrderNumber
DoCmd.OpenReport "MyReport", acViewNormal, , strCriteria

In the event that you have not done much VBA coding of events, here
are
the
steps needed to put the code "behind a button":

1. Right click on the desired Command Button (let's call it:
CommandRunReport) control and select Properties.

2. When the Properties sheet opens, click the tab labeled Event.

3. In the grid below, locate the row labeled, On Click. It should be blank.
Click anywhere in the white space to the right of the label and you
will
see
a downward-pointing arrow appear, indicating that this is also a ComboBox.
Click the arrow and select "Event Procedure".

4. Then, notice that there is an ellipsis or three little dots (...)
to
the
right of the ComboBox. Click the ellipsis and you will open a code window.
You will see that Access has given you a space for entering some code in
this event - it will look something like the following:

Private Sub Private Sub CommandRunReport_Click()

End Sub

5. After the "Private Sub Private Sub CommandRunReport_Click()" line,
insert the code provided earlier.

6. Click the Save icon and close the Microsoft Visual Basic code window.




--

Cheryl Fischer, MVP Microsoft Access



I am very new to Access and have been working forever to try to get a
simple form together for my boss. It's a form which tracks incoming work
orders on vehicles complete with a work order number, date incoming, date
expected back, date sent out for service, where and a few other items. At
the bottom of the form I want a command button that reads print form which
would print only one form. I have read tons of information concerning not
printing forms but rather to set up a report and print that instead.
I
have
also read alot about VBA's (very confusing information-to me) Printing a
report is fine with me - I have set one up that looks beautiful, now my
biggest dilema. I need step-by-step instructions (remember I'm really dumb)
on how to link the command button on the form to the report. Also,
I'm
sure
you've figured out I need to print one form or report at time. You
have
no
idea how much I would appreciate any help given.
 
H

hcj

Maybe all you need to do is make the command button on the
form print the RECORD, not the FORM. When you set up the
command button using the wizard, select Record Operations
and then Print Record, rather than using Form Operations.

By the way - this is not a dumb question. It's a great
question. You may be surprised how many people you'll
help by simply asking questions!
Hope this helps.
-----Original Message-----
I am very new to Access and have been working forever to
try to get a simple form together for my boss. It's a
form which tracks incoming work orders on vehicles
complete with a work order number, date incoming, date
expected back, date sent out for service, where and a few
other items. At the bottom of the form I want a command
button that reads print form which would print only one
form. I have read tons of information concerning not
printing forms but rather to set up a report and print
that instead. I have also read alot about VBA's (very
confusing information-to me) Printing a report is fine
with me - I have set one up that looks beautiful, now my
biggest dilema. I need step-by-step instructions
(remember I'm really dumb) on how to link the command
button on the form to the report. Also, I'm sure you've
figured out I need to print one form or report at time.
You have no idea how much I would appreciate any help
given.
 
G

Guest

Thanks I think (?) Cheryl for the info. Still no report printing going on. After entering the formula you left I receive the error message Compile Error - Syntax Error. I swear it looks just like the one you posted. Anyhow in your step-by-step instructions (I told you I am really dumb) I was a little confused. In your formula you are using words such as WorkOrderNumber and My Report - I'm not quite sure what if anything I am supposed to substitue for these? Also when your entering code other items are on the screen such as On Error Go To..

Does all this stay in the formula?

By the way the name of my form, database and report are all called Work Order

Well another day has passed - still no form to impress the boss. He's wondering why this is taking me so long. I've been reading the Access for Dummies book also to no avail. Now what - any suggestions would be greatly appreciated.
 
J

John Vinson

Thanks I think (?) Cheryl for the info. Still no report printing going on. After entering the formula you left I receive the error message Compile Error - Syntax Error. I swear it looks just like the one you posted. Anyhow in your step-by-step instructions (I told you I am really dumb) I was a little confused. In your formula you are using words such as WorkOrderNumber and My Report - I'm not quite sure what if anything I am supposed to substitue for these? Also when your entering code other items are on the screen such as On Error Go To...

Does all this stay in the formula?

By the way the name of my form, database and report are all called Work Order.

Well another day has passed - still no form to impress the boss. He's wondering why this is taking me so long. I've been reading the Access for Dummies book also to no avail. Now what - any suggestions would be greatly appreciated.

Jumping in since Cheryl hasn't replied -

Please post your code. There is something wrong with it, but since you
don't show us what you did, it's more than a little bit difficult to
guess WHAT might be wrong.
 
C

Cheryl Fischer

kdc,

When you don't tell us the names of Controls on your form, Fields in your
table, etc., we have to guess at what they are. I should also have said:
Please substitute your own Field and Control names for those in the code
supplied here.

' This works when your WorkOrderNumber field is text

Dim strCriteria As String
strCriteria = "[WorkOrderNumber] = " & Chr(34) & Me!WorkOrderNumber &
Chr(34)
DoCmd.OpenReport "Work Order", acViewNormal, , strCriteria

' This works when your WorkOrderNumber field is a number

Dim strCriteria As String
strCriteria = "[WorkOrderNumber] = " & Me!WorkOrderNumber
DoCmd.OpenReport "Work Order", acViewNormal, , strCriteria

In the above code, please give attention to the following line:

strCriteria = "[WorkOrderNumber] = " & Me!WorkOrderNumber

The above line is a SQL Where Clause which instructs Access which records to
retrieve for your report, which in the situation you describe, is any record
in the Table/Query in the recordsource of your report which has a field
value in its unique identifier (WorkOrderNumber, maybe?, OrderID?, ID?)
which matches the Control name in which the same data is found.
Unfortunately, it was necessary to guess at what your field and control
names were! Therefore, the first occurrence of WorkOrderNumber refers to
the control on the report you want to run; the second occurrence refers to
the control on your form. *Substitute the names I used for these Controls
with the names that YOU are using in your database.*

Note: the above also applies to the code example supplied in case the
matching values (Report x Form) are Text.
Well another day has passed - still no form to impress the boss.

<smile>
--

Cheryl Fischer, MVP Microsoft Access



kdc said:
Thanks I think (?) Cheryl for the info. Still no report printing going
on. After entering the formula you left I receive the error message Compile
Error - Syntax Error. I swear it looks just like the one you posted.
Anyhow in your step-by-step instructions (I told you I am really dumb) I was
a little confused. In your formula you are using words such as
WorkOrderNumber and My Report - I'm not quite sure what if anything I am
supposed to substitue for these? Also when your entering code other items
are on the screen such as On Error Go To...
Does all this stay in the formula?

By the way the name of my form, database and report are all called Work Order.

Well another day has passed - still no form to impress the boss. He's
wondering why this is taking me so long. I've been reading the Access for
Dummies book also to no avail. Now what - any suggestions would be greatly
appreciated.
 
C

Cheryl Fischer

Thank you, John! I did some work in the groups this morning, but could not
be available this afternoon.

--

Cheryl Fischer, MVP Microsoft Access



on. After entering the formula you left I receive the error message Compile
Error - Syntax Error. I swear it looks just like the one you posted.
Anyhow in your step-by-step instructions (I told you I am really dumb) I was
a little confused. In your formula you are using words such as
WorkOrderNumber and My Report - I'm not quite sure what if anything I am
supposed to substitue for these? Also when your entering code other items
are on the screen such as On Error Go To...wondering why this is taking me so long. I've been reading the Access for
Dummies book also to no avail. Now what - any suggestions would be greatly
appreciated.
 
G

Guest

Good Morning: This is the code I've entered which comes up: Compile Error - Syntax Erro

Private Sub Command48_Click(
Dim strCriteria As Strin
strCriteria="[Work Order Number]="&Me!Work Order Numbe
DoCmd.OpenReport "Work Order", acViewNormal, , strCriteri

On Error GoTo Err_Command48_Clic

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer7
DoCmd.PrintOut acSelectio

Exit_Command48_Click
Exit Su

Err_Command48_Click
MsgBox Err.Descriptio
Resume Exit_Command48_Clic

End Su


Once Again - Thanks for any and all help - I hope I'm getting close! Have a great day.
 
C

Cheryl Fischer

If you will put brackets [] around the second occurrence of "Work Order
Number", your report should open appropriately ...

strCriteria="[Work Order Number]="&Me![Work Order Number]

hth,
--

Cheryl Fischer, MVP Microsoft Access



kdc said:
Good Morning: This is the code I've entered which comes up: Compile Error - Syntax Error

Private Sub Command48_Click()
Dim strCriteria As String
strCriteria="[Work Order Number]="&Me!Work Order Number
DoCmd.OpenReport "Work Order", acViewNormal, , strCriteria

On Error GoTo Err_Command48_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_Command48_Click:
Exit Sub

Err_Command48_Click:
MsgBox Err.Description
Resume Exit_Command48_Click

End Sub



Once Again - Thanks for any and all help - I hope I'm getting close! Have
a great day.
 
G

Guest

Cheryl, I think I'm almost there: Now I get the error code that reads: Run Time Error 2465: Microsoft Office Access can't find the field "Work Order Number" referred to in your expression.
 
C

Cheryl Fischer

What is the Name of the Control on your form which contains your Work Order
Number value?

Is the Name of this Control the same as the field name found in the Control
Source?

If the Field name found in the Control Source is not the same as the Name of
the Control, what field name does Control Source contain?

To get this information, right click on the control on your form which
contains the Work Order Number. Select Properties. The information
needed for the above three questions is found in Properties.

hth,
--

Cheryl Fischer, MVP Microsoft Access



kdc said:
Cheryl, I think I'm almost there: Now I get the error code that reads:
Run Time Error 2465: Microsoft Office Access can't find the field "Work
Order Number" referred to in your expression.
 
C

Cheryl Fischer

Cool!!!

Could be that the printing out of the form is cause by this code that you
supplied ...

On Error GoTo Err_Command48_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection


Try commenting out these lines and see what happens.

--

Cheryl Fischer, MVP Microsoft Access



kdc said:
GUESS WHAT????????????????????? It printed !!!!!!!!!!!!!!!!!!!!!!!!!!

The problem was the name of the control was work order # and not work
order number. The only problem (and at this point I'm just happy it
printed) is that not only does my beautiful report print, but a copy of the
form prints as well. Note: The form and the report are both called work
order - is this the problem?
 
G

Guest

Cheryl- you truly are a genius. I printed just the report from the form in one click. I have been working on and off (more off than on just because I was so frustrated) on this form for well over a month. My boss will be estatic. I have to work out a few more what I hope will be minor adjustments and them I'm good to go. I can't thank you enough for all your help and patience along the way. I just hope "THE BOSS" doesn't have many questions, because I'm still not sure what it is that I did! Have a terrific l o n g weekend and again "THANK YOU" from the bottom of my heart.
 
C

Cheryl Fischer

You're welcome and good luck with your project! As always, please post
back with any additional questions; we are here to help.

--

Cheryl Fischer, MVP Microsoft Access



kdc said:
Cheryl- you truly are a genius. I printed just the report from the form
in one click. I have been working on and off (more off than on just because
I was so frustrated) on this form for well over a month. My boss will be
estatic. I have to work out a few more what I hope will be minor
adjustments and them I'm good to go. I can't thank you enough for all your
help and patience along the way. I just hope "THE BOSS" doesn't have many
questions, because I'm still not sure what it is that I did! Have a
terrific l o n g weekend and again "THANK YOU" from the bottom of my heart.
 
G

Guest

Hi - It's me again. I guess I was just so happy to hear the printer go off - I didn't pay too much attention to what the form was printing. When I hit print form all that spits out is a blank work order form - none of the information I entered shows up. Simple Solution???
 

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