Runtime Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get a 2103 runtime error when I try to open a report using two combo boxes
on a form.
 
What is the error, in words?
Can you post the code you are using to open the report?
And what do you use to filter the report using the combo's?
 
The error states - The report name 'R002_Report_After_Update' you entered in
either the property sheet or macro is misspelled or refers to a report that
doesn't exist.

Below is my code.

Thank you for any help you can give me. I am just learning Access VB.

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.cboYear) Then
stWhere = "[report name] = """ & Me.cboYear & """"
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere
 
Dim stDocName As String
Dim stWhere As String
Dim StDoc As String

' ****************************************
' Is that the report name you are trying to open *****
StDoc = "R002_Report_After_Update"
' ***************************************
If Not IsNull(Me.cboYear) Then
' ************************************************
' Is [report name] is the name of the field you want to filter on? **
stWhere = "[report name] = """ & Me.cboYear & """"
' ************************************************
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
' ************************************************
' You have the same field name again on a second criteria (even if it is
the field
name you will get no resault in the report the field can't be equal to two
values. change the And to OR
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "

' ************************************************
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


--
Good Luck
BS"D


Shari said:
The error states - The report name 'R002_Report_After_Update' you entered in
either the property sheet or macro is misspelled or refers to a report that
doesn't exist.

Below is my code.

Thank you for any help you can give me. I am just learning Access VB.

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.cboYear) Then
stWhere = "[report name] = """ & Me.cboYear & """"
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


Ofer Cohen said:
What is the error, in words?
Can you post the code you are using to open the report?
And what do you use to filter the report using the combo's?
 
Thank you, I will give it a try.


Ofer Cohen said:
Dim stDocName As String
Dim stWhere As String
Dim StDoc As String

' ****************************************
' Is that the report name you are trying to open *****
StDoc = "R002_Report_After_Update"
' ***************************************
If Not IsNull(Me.cboYear) Then
' ************************************************
' Is [report name] is the name of the field you want to filter on? **
stWhere = "[report name] = """ & Me.cboYear & """"
' ************************************************
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
' ************************************************
' You have the same field name again on a second criteria (even if it is
the field
name you will get no resault in the report the field can't be equal to two
values. change the And to OR
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "

' ************************************************
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


--
Good Luck
BS"D


Shari said:
The error states - The report name 'R002_Report_After_Update' you entered in
either the property sheet or macro is misspelled or refers to a report that
doesn't exist.

Below is my code.

Thank you for any help you can give me. I am just learning Access VB.

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.cboYear) Then
stWhere = "[report name] = """ & Me.cboYear & """"
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


Ofer Cohen said:
What is the error, in words?
Can you post the code you are using to open the report?
And what do you use to filter the report using the combo's?


--
Good Luck
BS"D


:

I get a 2103 runtime error when I try to open a report using two combo boxes
on a form.
 
If you need help with the code, please post
1. Report name
2. The name of the fields in the table you want to filter on
3. which name of the objects in the form that refer to the field from 2
4. The field type (numeric , text , date)

--
Good Luck
BS"D


Shari said:
Thank you, I will give it a try.


Ofer Cohen said:
Dim stDocName As String
Dim stWhere As String
Dim StDoc As String

' ****************************************
' Is that the report name you are trying to open *****
StDoc = "R002_Report_After_Update"
' ***************************************
If Not IsNull(Me.cboYear) Then
' ************************************************
' Is [report name] is the name of the field you want to filter on? **
stWhere = "[report name] = """ & Me.cboYear & """"
' ************************************************
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
' ************************************************
' You have the same field name again on a second criteria (even if it is
the field
name you will get no resault in the report the field can't be equal to two
values. change the And to OR
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "

' ************************************************
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


--
Good Luck
BS"D


Shari said:
The error states - The report name 'R002_Report_After_Update' you entered in
either the property sheet or macro is misspelled or refers to a report that
doesn't exist.

Below is my code.

Thank you for any help you can give me. I am just learning Access VB.

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.cboYear) Then
stWhere = "[report name] = """ & Me.cboYear & """"
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


:

What is the error, in words?
Can you post the code you are using to open the report?
And what do you use to filter the report using the combo's?


--
Good Luck
BS"D


:

I get a 2103 runtime error when I try to open a report using two combo boxes
on a form.
 
I changed the code to the following and I am still getting the run time
error. I have year as a number field in my table and UIC as a text field in
the table. I want to filter on year and UIC, when the user selects the year
and uic from two combo boxes on the form , I want to open a report showing
that year and uic's fiscal information.

Do I have to set any properties? Is this the reason why it is not working.
It seems like an easy thing to do, but I am having problems with it.

Again, thank you for your help.


Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.RYear) Then
stWhere = "[Year] = """ & Me.RYear & """"
End If
If Not IsNull(Me.RUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[UIC] = """ & Me.RUIC & """"
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


Ofer Cohen said:
Dim stDocName As String
Dim stWhere As String
Dim StDoc As String

' ****************************************
' Is that the report name you are trying to open *****
StDoc = "R002_Report_After_Update"
' ***************************************
If Not IsNull(Me.cboYear) Then
' ************************************************
' Is [report name] is the name of the field you want to filter on? **
stWhere = "[report name] = """ & Me.cboYear & """"
' ************************************************
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
' ************************************************
' You have the same field name again on a second criteria (even if it is
the field
name you will get no resault in the report the field can't be equal to two
values. change the And to OR
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "

' ************************************************
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


--
Good Luck
BS"D


Shari said:
The error states - The report name 'R002_Report_After_Update' you entered in
either the property sheet or macro is misspelled or refers to a report that
doesn't exist.

Below is my code.

Thank you for any help you can give me. I am just learning Access VB.

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.cboYear) Then
stWhere = "[report name] = """ & Me.cboYear & """"
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


Ofer Cohen said:
What is the error, in words?
Can you post the code you are using to open the report?
And what do you use to filter the report using the combo's?


--
Good Luck
BS"D


:

I get a 2103 runtime error when I try to open a report using two combo boxes
on a form.
 
Do you get the same error?

In any case, adding a criteria on a numeric field you need to change it to

stWhere = "[Year] = " & Me.RYear

droping the single quote

--
Good Luck
BS"D


Shari said:
I changed the code to the following and I am still getting the run time
error. I have year as a number field in my table and UIC as a text field in
the table. I want to filter on year and UIC, when the user selects the year
and uic from two combo boxes on the form , I want to open a report showing
that year and uic's fiscal information.

Do I have to set any properties? Is this the reason why it is not working.
It seems like an easy thing to do, but I am having problems with it.

Again, thank you for your help.


Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.RYear) Then
stWhere = "[Year] = """ & Me.RYear & """"
End If
If Not IsNull(Me.RUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[UIC] = """ & Me.RUIC & """"
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


Ofer Cohen said:
Dim stDocName As String
Dim stWhere As String
Dim StDoc As String

' ****************************************
' Is that the report name you are trying to open *****
StDoc = "R002_Report_After_Update"
' ***************************************
If Not IsNull(Me.cboYear) Then
' ************************************************
' Is [report name] is the name of the field you want to filter on? **
stWhere = "[report name] = """ & Me.cboYear & """"
' ************************************************
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
' ************************************************
' You have the same field name again on a second criteria (even if it is
the field
name you will get no resault in the report the field can't be equal to two
values. change the And to OR
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "

' ************************************************
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


--
Good Luck
BS"D


Shari said:
The error states - The report name 'R002_Report_After_Update' you entered in
either the property sheet or macro is misspelled or refers to a report that
doesn't exist.

Below is my code.

Thank you for any help you can give me. I am just learning Access VB.

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.cboYear) Then
stWhere = "[report name] = """ & Me.cboYear & """"
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


:

What is the error, in words?
Can you post the code you are using to open the report?
And what do you use to filter the report using the combo's?


--
Good Luck
BS"D


:

I get a 2103 runtime error when I try to open a report using two combo boxes
on a form.
 
Thank you, I noticed that error myself and yes, I am still getting the same
error message.
"R002_Report_After_Update" is the name of the report I am trying to open.


Ofer Cohen said:
Do you get the same error?

In any case, adding a criteria on a numeric field you need to change it to

stWhere = "[Year] = " & Me.RYear

droping the single quote

--
Good Luck
BS"D


Shari said:
I changed the code to the following and I am still getting the run time
error. I have year as a number field in my table and UIC as a text field in
the table. I want to filter on year and UIC, when the user selects the year
and uic from two combo boxes on the form , I want to open a report showing
that year and uic's fiscal information.

Do I have to set any properties? Is this the reason why it is not working.
It seems like an easy thing to do, but I am having problems with it.

Again, thank you for your help.


Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.RYear) Then
stWhere = "[Year] = """ & Me.RYear & """"
End If
If Not IsNull(Me.RUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[UIC] = """ & Me.RUIC & """"
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


Ofer Cohen said:
Dim stDocName As String
Dim stWhere As String
Dim StDoc As String

' ****************************************
' Is that the report name you are trying to open *****
StDoc = "R002_Report_After_Update"
' ***************************************
If Not IsNull(Me.cboYear) Then
' ************************************************
' Is [report name] is the name of the field you want to filter on? **
stWhere = "[report name] = """ & Me.cboYear & """"
' ************************************************
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
' ************************************************
' You have the same field name again on a second criteria (even if it is
the field
name you will get no resault in the report the field can't be equal to two
values. change the And to OR
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "

' ************************************************
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


--
Good Luck
BS"D


:

The error states - The report name 'R002_Report_After_Update' you entered in
either the property sheet or macro is misspelled or refers to a report that
doesn't exist.

Below is my code.

Thank you for any help you can give me. I am just learning Access VB.

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.cboYear) Then
stWhere = "[report name] = """ & Me.cboYear & """"
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


:

What is the error, in words?
Can you post the code you are using to open the report?
And what do you use to filter the report using the combo's?


--
Good Luck
BS"D


:

I get a 2103 runtime error when I try to open a report using two combo boxes
on a form.
 
Is "R002_Report_After_Update" is the name of the report?

--
Good Luck
BS"D


Shari said:
Thank you, I noticed that error myself and yes, I am still getting the same
error message.
"R002_Report_After_Update" is the name of the report I am trying to open.


Ofer Cohen said:
Do you get the same error?

In any case, adding a criteria on a numeric field you need to change it to

stWhere = "[Year] = " & Me.RYear

droping the single quote

--
Good Luck
BS"D


Shari said:
I changed the code to the following and I am still getting the run time
error. I have year as a number field in my table and UIC as a text field in
the table. I want to filter on year and UIC, when the user selects the year
and uic from two combo boxes on the form , I want to open a report showing
that year and uic's fiscal information.

Do I have to set any properties? Is this the reason why it is not working.
It seems like an easy thing to do, but I am having problems with it.

Again, thank you for your help.


Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.RYear) Then
stWhere = "[Year] = """ & Me.RYear & """"
End If
If Not IsNull(Me.RUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[UIC] = """ & Me.RUIC & """"
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


:

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String

' ****************************************
' Is that the report name you are trying to open *****
StDoc = "R002_Report_After_Update"
' ***************************************
If Not IsNull(Me.cboYear) Then
' ************************************************
' Is [report name] is the name of the field you want to filter on? **
stWhere = "[report name] = """ & Me.cboYear & """"
' ************************************************
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
' ************************************************
' You have the same field name again on a second criteria (even if it is
the field
name you will get no resault in the report the field can't be equal to two
values. change the And to OR
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "

' ************************************************
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


--
Good Luck
BS"D


:

The error states - The report name 'R002_Report_After_Update' you entered in
either the property sheet or macro is misspelled or refers to a report that
doesn't exist.

Below is my code.

Thank you for any help you can give me. I am just learning Access VB.

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.cboYear) Then
stWhere = "[report name] = """ & Me.cboYear & """"
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


:

What is the error, in words?
Can you post the code you are using to open the report?
And what do you use to filter the report using the combo's?


--
Good Luck
BS"D


:

I get a 2103 runtime error when I try to open a report using two combo boxes
on a form.
 
Yes it is.
Thanks for your help.

Ofer Cohen said:
Is "R002_Report_After_Update" is the name of the report?

--
Good Luck
BS"D


Shari said:
Thank you, I noticed that error myself and yes, I am still getting the same
error message.
"R002_Report_After_Update" is the name of the report I am trying to open.


Ofer Cohen said:
Do you get the same error?

In any case, adding a criteria on a numeric field you need to change it to

stWhere = "[Year] = " & Me.RYear

droping the single quote

--
Good Luck
BS"D


:

I changed the code to the following and I am still getting the run time
error. I have year as a number field in my table and UIC as a text field in
the table. I want to filter on year and UIC, when the user selects the year
and uic from two combo boxes on the form , I want to open a report showing
that year and uic's fiscal information.

Do I have to set any properties? Is this the reason why it is not working.
It seems like an easy thing to do, but I am having problems with it.

Again, thank you for your help.


Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.RYear) Then
stWhere = "[Year] = """ & Me.RYear & """"
End If
If Not IsNull(Me.RUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[UIC] = """ & Me.RUIC & """"
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


:

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String

' ****************************************
' Is that the report name you are trying to open *****
StDoc = "R002_Report_After_Update"
' ***************************************
If Not IsNull(Me.cboYear) Then
' ************************************************
' Is [report name] is the name of the field you want to filter on? **
stWhere = "[report name] = """ & Me.cboYear & """"
' ************************************************
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
' ************************************************
' You have the same field name again on a second criteria (even if it is
the field
name you will get no resault in the report the field can't be equal to two
values. change the And to OR
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "

' ************************************************
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


--
Good Luck
BS"D


:

The error states - The report name 'R002_Report_After_Update' you entered in
either the property sheet or macro is misspelled or refers to a report that
doesn't exist.

Below is my code.

Thank you for any help you can give me. I am just learning Access VB.

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.cboYear) Then
stWhere = "[report name] = """ & Me.cboYear & """"
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


:

What is the error, in words?
Can you post the code you are using to open the report?
And what do you use to filter the report using the combo's?


--
Good Luck
BS"D


:

I get a 2103 runtime error when I try to open a report using two combo boxes
on a form.
 
If you still have the error, you can mail me the mdb, I can check that code
If you decide to do that, mail it to

chamudim <@> hotmail <.> com

send it ziped, other wise hotmail will reject it
Thanks
--
Good Luck
BS"D


Shari said:
Yes it is.
Thanks for your help.

Ofer Cohen said:
Is "R002_Report_After_Update" is the name of the report?

--
Good Luck
BS"D


Shari said:
Thank you, I noticed that error myself and yes, I am still getting the same
error message.
"R002_Report_After_Update" is the name of the report I am trying to open.


:

Do you get the same error?

In any case, adding a criteria on a numeric field you need to change it to

stWhere = "[Year] = " & Me.RYear

droping the single quote

--
Good Luck
BS"D


:

I changed the code to the following and I am still getting the run time
error. I have year as a number field in my table and UIC as a text field in
the table. I want to filter on year and UIC, when the user selects the year
and uic from two combo boxes on the form , I want to open a report showing
that year and uic's fiscal information.

Do I have to set any properties? Is this the reason why it is not working.
It seems like an easy thing to do, but I am having problems with it.

Again, thank you for your help.


Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.RYear) Then
stWhere = "[Year] = """ & Me.RYear & """"
End If
If Not IsNull(Me.RUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[UIC] = """ & Me.RUIC & """"
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


:

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String

' ****************************************
' Is that the report name you are trying to open *****
StDoc = "R002_Report_After_Update"
' ***************************************
If Not IsNull(Me.cboYear) Then
' ************************************************
' Is [report name] is the name of the field you want to filter on? **
stWhere = "[report name] = """ & Me.cboYear & """"
' ************************************************
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
' ************************************************
' You have the same field name again on a second criteria (even if it is
the field
name you will get no resault in the report the field can't be equal to two
values. change the And to OR
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "

' ************************************************
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


--
Good Luck
BS"D


:

The error states - The report name 'R002_Report_After_Update' you entered in
either the property sheet or macro is misspelled or refers to a report that
doesn't exist.

Below is my code.

Thank you for any help you can give me. I am just learning Access VB.

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.cboYear) Then
stWhere = "[report name] = """ & Me.cboYear & """"
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


:

What is the error, in words?
Can you post the code you are using to open the report?
And what do you use to filter the report using the combo's?


--
Good Luck
BS"D


:

I get a 2103 runtime error when I try to open a report using two combo boxes
on a form.
 
Thank you for your help. I finally got it to work, I created a combo box
using the wizard and copied that open statement into my code and added the
where clause.

I do have two other questions, when the user accidently clicks somewhere on
the form other than in a combo box another one of my forms open. This
second form is tied to a macro. I do not know if that is the cause or not.

Second question, on my report that is opened from the form, I have a custom
tool bar attached that the user can click to close the report. When I click
the toolbar it takes me back to the form and I would like instead to go back
to the switchboard. Is this possible.

Again, I appreciate any help you can give me.


Ofer Cohen said:
If you still have the error, you can mail me the mdb, I can check that code
If you decide to do that, mail it to

chamudim <@> hotmail <.> com

send it ziped, other wise hotmail will reject it
Thanks
--
Good Luck
BS"D


Shari said:
Yes it is.
Thanks for your help.

Ofer Cohen said:
Is "R002_Report_After_Update" is the name of the report?

--
Good Luck
BS"D


:

Thank you, I noticed that error myself and yes, I am still getting the same
error message.
"R002_Report_After_Update" is the name of the report I am trying to open.


:

Do you get the same error?

In any case, adding a criteria on a numeric field you need to change it to

stWhere = "[Year] = " & Me.RYear

droping the single quote

--
Good Luck
BS"D


:

I changed the code to the following and I am still getting the run time
error. I have year as a number field in my table and UIC as a text field in
the table. I want to filter on year and UIC, when the user selects the year
and uic from two combo boxes on the form , I want to open a report showing
that year and uic's fiscal information.

Do I have to set any properties? Is this the reason why it is not working.
It seems like an easy thing to do, but I am having problems with it.

Again, thank you for your help.


Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.RYear) Then
stWhere = "[Year] = """ & Me.RYear & """"
End If
If Not IsNull(Me.RUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[UIC] = """ & Me.RUIC & """"
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


:

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String

' ****************************************
' Is that the report name you are trying to open *****
StDoc = "R002_Report_After_Update"
' ***************************************
If Not IsNull(Me.cboYear) Then
' ************************************************
' Is [report name] is the name of the field you want to filter on? **
stWhere = "[report name] = """ & Me.cboYear & """"
' ************************************************
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
' ************************************************
' You have the same field name again on a second criteria (even if it is
the field
name you will get no resault in the report the field can't be equal to two
values. change the And to OR
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "

' ************************************************
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


--
Good Luck
BS"D


:

The error states - The report name 'R002_Report_After_Update' you entered in
either the property sheet or macro is misspelled or refers to a report that
doesn't exist.

Below is my code.

Thank you for any help you can give me. I am just learning Access VB.

Dim stDocName As String
Dim stWhere As String
Dim StDoc As String
StDoc = "R002_Report_After_Update"

If Not IsNull(Me.cboYear) Then
stWhere = "[report name] = """ & Me.cboYear & """"
End If
If Not IsNull(Me.cboUIC) Then
If Len(stWhere) > 0 Then
stWhere = stWhere & " And "
End If
stWhere = stWhere & "[report name] = """ & Me.cbo UIC & """ "
End If
DoCmd.OpenReport StDoc, acViewPreview, , stWhere


:

What is the error, in words?
Can you post the code you are using to open the report?
And what do you use to filter the report using the combo's?


--
Good Luck
BS"D


:

I get a 2103 runtime error when I try to open a report using two combo boxes
on a form.
 
Back
Top