error 2451

M

MNJoe

OK, I am a dummy. I have a new access report and I have the query working
perfect and the report is coming out exactly the way I want it. I have 3
variables in the query that are coming up as message boxes right now and it
works great. Now I am trying to create an input form for the users to input
these 3 variables to get their output for which customer and range of work
orders. I have 3 unbound fields in the form a start button and a cancel
button. I changed the queery to try and pull the input from the form. The
where part of the query is this.

WHERE (((SYSADM_WORK_ORDER.TYPE)='W') AND
((SYSADM_WORK_ORDER.BASE_ID)>=[forms]![Matterial Requirement
form]![Starting_Work_Order_ID] And
(SYSADM_WORK_ORDER.BASE_ID)<=[forms]![Matterial Requirement
form]![Ending_Work_Order_ID]) AND
((SYSADM_WORK_ORDER.STATUS) In ('F','R','U')) AND
((SYSADM_WORK_ORDER.SUB_ID)="0") AND
((SYSADM_WORK_ORDER.PART_ID) Like 'F-' & [forms]![material requirement
form]![customerid] & '%') AND
((SYSADM_REQUIREMENT.PART_ID)<>(IsNull([SYSADM_REQUIREMENT].[PART_ID])) And
(SYSADM_REQUIREMENT.PART_ID)<>' ') AND
((SYSADM_REQUIREMENT.STATUS) In ('F','R','U')));

the code for the start button is below. This is when I get the run time
error 2451. The report name 'MaterialRequirement' you entered is misspelled
or refers to a report that isn't open or doesn't exist.


Private Sub CMD_Start_Click()
DoCmd.OpenReport [Reports]![MaterialRequirement], acViewPreview
End Sub

I have been all through this. I am just not getting how access behaves when
it is doig this. Thanks for your help!!
 
S

Steve Sanford

First thing is check your spelling.

You have:
=[forms]![Matterial Requirement form]![Starting_Work_Order_ID]
<=[forms]![Matterial Requirement form]![Ending_Work_Order_ID]
& [forms]![material requirement form]![customerid] & '%'

How do YOU spell "material"? One "T" or two??? :)

HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)

OK, I am a dummy. I have a new access report and I have the query working
perfect and the report is coming out exactly the way I want it. I have 3
variables in the query that are coming up as message boxes right now and it
works great. Now I am trying to create an input form for the users to input
these 3 variables to get their output for which customer and range of work
orders. I have 3 unbound fields in the form a start button and a cancel
button. I changed the queery to try and pull the input from the form. The
where part of the query is this.

WHERE (((SYSADM_WORK_ORDER.TYPE)='W') AND
((SYSADM_WORK_ORDER.BASE_ID)>=[forms]![Matterial Requirement
form]![Starting_Work_Order_ID] And
(SYSADM_WORK_ORDER.BASE_ID)<=[forms]![Matterial Requirement
form]![Ending_Work_Order_ID]) AND
((SYSADM_WORK_ORDER.STATUS) In ('F','R','U')) AND
((SYSADM_WORK_ORDER.SUB_ID)="0") AND
((SYSADM_WORK_ORDER.PART_ID) Like 'F-' & [forms]![material requirement
form]![customerid] & '%') AND
((SYSADM_REQUIREMENT.PART_ID)<>(IsNull([SYSADM_REQUIREMENT].[PART_ID])) And
(SYSADM_REQUIREMENT.PART_ID)<>' ') AND
((SYSADM_REQUIREMENT.STATUS) In ('F','R','U')));

the code for the start button is below. This is when I get the run time
error 2451. The report name 'MaterialRequirement' you entered is misspelled
or refers to a report that isn't open or doesn't exist.


Private Sub CMD_Start_Click()
DoCmd.OpenReport [Reports]![MaterialRequirement], acViewPreview
End Sub

I have been all through this. I am just not getting how access behaves when
it is doig this. Thanks for your help!!
 

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