Combo box

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

Guest

I have a form with 1 combo box on it. on the drop down menu there are a
number of names. when a specific name is selected how do i get it to open
thr report corresponding to that name i.e. when "Jane" is selcted from the
list, the report "jane opens"
 
Look at this link on "Printing the Record on the Microsoft Access Form to a
Report"

http://www.databasedev.co.uk/report_from_form_record.html

In addition, if the filter is on a text field, change the filter adding
single quote for a string

This line:
strCriteria = "[lngSalespersonID]= " & Me![lngSalespersonID]

will turn into
strCriteria = "[lngSalespersonID]= '" & Me![lngSalespersonID] & "'"
 
I followed the code in the link and an error comes up, the error being "RUN
TIME ERROR '424'
OBJECT REQUIRED".

the code i entered was:

Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = [Combo4]
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If
End Sub


on Debug it highlighted the "DoCmd line". i used [Combo4] as the report
name as i have a list of reports to choose from and the one i want to select
is defined by what is selected in the combo box. what am i doing wrong.


Ofer Cohen said:
Look at this link on "Printing the Record on the Microsoft Access Form to a
Report"

http://www.databasedev.co.uk/report_from_form_record.html

In addition, if the filter is on a text field, change the filter adding
single quote for a string

This line:
strCriteria = "[lngSalespersonID]= " & Me![lngSalespersonID]

will turn into
strCriteria = "[lngSalespersonID]= '" & Me![lngSalespersonID] & "'"

--
Good Luck
BS"D


Steve Moss said:
I have a form with 1 combo box on it. on the drop down menu there are a
number of names. when a specific name is selected how do i get it to open
thr report corresponding to that name i.e. when "Jane" is selcted from the
list, the report "jane opens"
 
Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
'************************************
' Enter here the report name, instead of the combo name
' strReportName = "Report Name"
'************************************
strReportName = [Combo4]
'******************************
' In the criteria you need to have
' "[FieldNameInThe Table]='" & Me![Combo4] & "'"
' ******************************
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If

--
Good Luck
BS"D


Steve Moss said:
I followed the code in the link and an error comes up, the error being "RUN
TIME ERROR '424'
OBJECT REQUIRED".

the code i entered was:

Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = [Combo4]
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If
End Sub


on Debug it highlighted the "DoCmd line". i used [Combo4] as the report
name as i have a list of reports to choose from and the one i want to select
is defined by what is selected in the combo box. what am i doing wrong.


Ofer Cohen said:
Look at this link on "Printing the Record on the Microsoft Access Form to a
Report"

http://www.databasedev.co.uk/report_from_form_record.html

In addition, if the filter is on a text field, change the filter adding
single quote for a string

This line:
strCriteria = "[lngSalespersonID]= " & Me![lngSalespersonID]

will turn into
strCriteria = "[lngSalespersonID]= '" & Me![lngSalespersonID] & "'"

--
Good Luck
BS"D


Steve Moss said:
I have a form with 1 combo box on it. on the drop down menu there are a
number of names. when a specific name is selected how do i get it to open
thr report corresponding to that name i.e. when "Jane" is selcted from the
list, the report "jane opens"
 
I am not sure what you mean. The Reports i have are "Bosun" "CO" "COXN"
"DMEO". in the drop down menu of the Combo box i have the values "Bosun"
"CO" "COXN" "DMEO". If i want to view the "CO" Report i would select the
"CO" value. i dont have a specific Report name until i select it in the drop
down list.

Ofer Cohen said:
Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
'************************************
' Enter here the report name, instead of the combo name
' strReportName = "Report Name"
'************************************
strReportName = [Combo4]
'******************************
' In the criteria you need to have
' "[FieldNameInThe Table]='" & Me![Combo4] & "'"
' ******************************
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If

--
Good Luck
BS"D


Steve Moss said:
I followed the code in the link and an error comes up, the error being "RUN
TIME ERROR '424'
OBJECT REQUIRED".

the code i entered was:

Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = [Combo4]
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If
End Sub


on Debug it highlighted the "DoCmd line". i used [Combo4] as the report
name as i have a list of reports to choose from and the one i want to select
is defined by what is selected in the combo box. what am i doing wrong.


Ofer Cohen said:
Look at this link on "Printing the Record on the Microsoft Access Form to a
Report"

http://www.databasedev.co.uk/report_from_form_record.html

In addition, if the filter is on a text field, change the filter adding
single quote for a string

This line:
strCriteria = "[lngSalespersonID]= " & Me![lngSalespersonID]

will turn into
strCriteria = "[lngSalespersonID]= '" & Me![lngSalespersonID] & "'"

--
Good Luck
BS"D


:

I have a form with 1 combo box on it. on the drop down menu there are a
number of names. when a specific name is selected how do i get it to open
thr report corresponding to that name i.e. when "Jane" is selcted from the
list, the report "jane opens"
 
It seems very strange that you have a field in the underlying recordset
named Combo4, which is what the criteria you've set indicates.

The syntax for the OpenReport method is:

DoCmd.OpenReport reportname[, view][, filtername][, wherecondition]

You're specifying a wherecondition, not a filter (filtername needs to be the
valid name of a query in the current database), so you want

DoComd.OpenReport strReportName, acViewPreview, , strCriteria


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Steve Moss said:
I followed the code in the link and an error comes up, the error being "RUN
TIME ERROR '424'
OBJECT REQUIRED".

the code i entered was:

Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = [Combo4]
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If
End Sub


on Debug it highlighted the "DoCmd line". i used [Combo4] as the report
name as i have a list of reports to choose from and the one i want to
select
is defined by what is selected in the combo box. what am i doing wrong.


Ofer Cohen said:
Look at this link on "Printing the Record on the Microsoft Access Form to
a
Report"

http://www.databasedev.co.uk/report_from_form_record.html

In addition, if the filter is on a text field, change the filter adding
single quote for a string

This line:
strCriteria = "[lngSalespersonID]= " & Me![lngSalespersonID]

will turn into
strCriteria = "[lngSalespersonID]= '" & Me![lngSalespersonID] & "'"

--
Good Luck
BS"D


Steve Moss said:
I have a form with 1 combo box on it. on the drop down menu there are
a
number of names. when a specific name is selected how do i get it to
open
thr report corresponding to that name i.e. when "Jane" is selcted from
the
list, the report "jane opens"
 
If you want to open the report based on the selection in the combo, and not
using the combo as a filter for the report (that what I thought you want),
then try

Private Sub Combo4_Click()
If Len(Trim(Me![Combo4]) & "")>0 Then
DoComd.OpenReport Me![Combo4], acViewPreview
Else
MsgBox "You need to select a report"
End If

End Sub

-----
Good Luck
BS"D

Steve Moss said:
I am not sure what you mean. The Reports i have are "Bosun" "CO" "COXN"
"DMEO". in the drop down menu of the Combo box i have the values "Bosun"
"CO" "COXN" "DMEO". If i want to view the "CO" Report i would select the
"CO" value. i dont have a specific Report name until i select it in the drop
down list.

Ofer Cohen said:
Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
'************************************
' Enter here the report name, instead of the combo name
' strReportName = "Report Name"
'************************************
strReportName = [Combo4]
'******************************
' In the criteria you need to have
' "[FieldNameInThe Table]='" & Me![Combo4] & "'"
' ******************************
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If

--
Good Luck
BS"D


Steve Moss said:
I followed the code in the link and an error comes up, the error being "RUN
TIME ERROR '424'
OBJECT REQUIRED".

the code i entered was:

Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = [Combo4]
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If
End Sub


on Debug it highlighted the "DoCmd line". i used [Combo4] as the report
name as i have a list of reports to choose from and the one i want to select
is defined by what is selected in the combo box. what am i doing wrong.


:

Look at this link on "Printing the Record on the Microsoft Access Form to a
Report"

http://www.databasedev.co.uk/report_from_form_record.html

In addition, if the filter is on a text field, change the filter adding
single quote for a string

This line:
strCriteria = "[lngSalespersonID]= " & Me![lngSalespersonID]

will turn into
strCriteria = "[lngSalespersonID]= '" & Me![lngSalespersonID] & "'"

--
Good Luck
BS"D


:

I have a form with 1 combo box on it. on the drop down menu there are a
number of names. when a specific name is selected how do i get it to open
thr report corresponding to that name i.e. when "Jane" is selcted from the
list, the report "jane opens"
 
If you want to open the report based on the selection in the combo, and not
using the combo as a filter for the report (that what I thought you want),
then try

Private Sub Combo4_Click()
If Len(Trim(Me![Combo4]) & "")>0 Then
DoComd.OpenReport Me![Combo4], acViewPreview
Else
MsgBox "You need to select a report"
End If

End Sub

-----
Good Luck
BS"D

Steve Moss said:
I am not sure what you mean. The Reports i have are "Bosun" "CO" "COXN"
"DMEO". in the drop down menu of the Combo box i have the values "Bosun"
"CO" "COXN" "DMEO". If i want to view the "CO" Report i would select the
"CO" value. i dont have a specific Report name until i select it in the drop
down list.

Ofer Cohen said:
Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
'************************************
' Enter here the report name, instead of the combo name
' strReportName = "Report Name"
'************************************
strReportName = [Combo4]
'******************************
' In the criteria you need to have
' "[FieldNameInThe Table]='" & Me![Combo4] & "'"
' ******************************
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If

--
Good Luck
BS"D


Steve Moss said:
I followed the code in the link and an error comes up, the error being "RUN
TIME ERROR '424'
OBJECT REQUIRED".

the code i entered was:

Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = [Combo4]
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If
End Sub


on Debug it highlighted the "DoCmd line". i used [Combo4] as the report
name as i have a list of reports to choose from and the one i want to select
is defined by what is selected in the combo box. what am i doing wrong.


:

Look at this link on "Printing the Record on the Microsoft Access Form to a
Report"

http://www.databasedev.co.uk/report_from_form_record.html

In addition, if the filter is on a text field, change the filter adding
single quote for a string

This line:
strCriteria = "[lngSalespersonID]= " & Me![lngSalespersonID]

will turn into
strCriteria = "[lngSalespersonID]= '" & Me![lngSalespersonID] & "'"

--
Good Luck
BS"D


:

I have a form with 1 combo box on it. on the drop down menu there are a
number of names. when a specific name is selected how do i get it to open
thr report corresponding to that name i.e. when "Jane" is selcted from the
list, the report "jane opens"
 
I think I am confusing myself. I think the best thing to do would be to
start again with this form. Mybe you could point me in the right direction.
My whole database is centred around 1 Table. In this table I have lists of
"Books of Reference". With different people i.e. "Bosun", "CO", "COXN" and
"DMEO" being custodian for different books. I have created a query to
display the books belonging to each of these people, with a Report created
from each query. I would like to use 1 form with 1 Combobox on it to select
which persons report I would like to look at. in the Row Source for the
Combobox i have "Bosun";"CO";"COXN";"DMEO" to choose from. how do i go about
getting this combobox to work.

I hope that is a little easier to understand.
Cheers

Douglas J. Steele said:
It seems very strange that you have a field in the underlying recordset
named Combo4, which is what the criteria you've set indicates.

The syntax for the OpenReport method is:

DoCmd.OpenReport reportname[, view][, filtername][, wherecondition]

You're specifying a wherecondition, not a filter (filtername needs to be the
valid name of a query in the current database), so you want

DoComd.OpenReport strReportName, acViewPreview, , strCriteria


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Steve Moss said:
I followed the code in the link and an error comes up, the error being "RUN
TIME ERROR '424'
OBJECT REQUIRED".

the code i entered was:

Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = [Combo4]
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If
End Sub


on Debug it highlighted the "DoCmd line". i used [Combo4] as the report
name as i have a list of reports to choose from and the one i want to
select
is defined by what is selected in the combo box. what am i doing wrong.


Ofer Cohen said:
Look at this link on "Printing the Record on the Microsoft Access Form to
a
Report"

http://www.databasedev.co.uk/report_from_form_record.html

In addition, if the filter is on a text field, change the filter adding
single quote for a string

This line:
strCriteria = "[lngSalespersonID]= " & Me![lngSalespersonID]

will turn into
strCriteria = "[lngSalespersonID]= '" & Me![lngSalespersonID] & "'"

--
Good Luck
BS"D


:

I have a form with 1 combo box on it. on the drop down menu there are
a
number of names. when a specific name is selected how do i get it to
open
thr report corresponding to that name i.e. when "Jane" is selcted from
the
list, the report "jane opens"
 
Thanks Ofer
I have just tried that code and it still comes up with the error on the line:-
DoComd.OpenReport Me![Combo4], acViewPreview

Ofer Cohen said:
If you want to open the report based on the selection in the combo, and not
using the combo as a filter for the report (that what I thought you want),
then try

Private Sub Combo4_Click()
If Len(Trim(Me![Combo4]) & "")>0 Then
DoComd.OpenReport Me![Combo4], acViewPreview
Else
MsgBox "You need to select a report"
End If

End Sub

-----
Good Luck
BS"D

Steve Moss said:
I am not sure what you mean. The Reports i have are "Bosun" "CO" "COXN"
"DMEO". in the drop down menu of the Combo box i have the values "Bosun"
"CO" "COXN" "DMEO". If i want to view the "CO" Report i would select the
"CO" value. i dont have a specific Report name until i select it in the drop
down list.

Ofer Cohen said:
Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
'************************************
' Enter here the report name, instead of the combo name
' strReportName = "Report Name"
'************************************
strReportName = [Combo4]
'******************************
' In the criteria you need to have
' "[FieldNameInThe Table]='" & Me![Combo4] & "'"
' ******************************
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If

--
Good Luck
BS"D


:

I followed the code in the link and an error comes up, the error being "RUN
TIME ERROR '424'
OBJECT REQUIRED".

the code i entered was:

Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = [Combo4]
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If
End Sub


on Debug it highlighted the "DoCmd line". i used [Combo4] as the report
name as i have a list of reports to choose from and the one i want to select
is defined by what is selected in the combo box. what am i doing wrong.


:

Look at this link on "Printing the Record on the Microsoft Access Form to a
Report"

http://www.databasedev.co.uk/report_from_form_record.html

In addition, if the filter is on a text field, change the filter adding
single quote for a string

This line:
strCriteria = "[lngSalespersonID]= " & Me![lngSalespersonID]

will turn into
strCriteria = "[lngSalespersonID]= '" & Me![lngSalespersonID] & "'"

--
Good Luck
BS"D


:

I have a form with 1 combo box on it. on the drop down menu there are a
number of names. when a specific name is selected how do i get it to open
thr report corresponding to that name i.e. when "Jane" is selcted from the
list, the report "jane opens"
 
I just noticed that, the DoComd has an extra o, use DoCmd


DoCmd.OpenReport Me![Combo4], acViewPreview


Steve Moss said:
Thanks Ofer
I have just tried that code and it still comes up with the error on the line:-
DoComd.OpenReport Me![Combo4], acViewPreview

Ofer Cohen said:
If you want to open the report based on the selection in the combo, and not
using the combo as a filter for the report (that what I thought you want),
then try

Private Sub Combo4_Click()
If Len(Trim(Me![Combo4]) & "")>0 Then
DoComd.OpenReport Me![Combo4], acViewPreview
Else
MsgBox "You need to select a report"
End If

End Sub

-----
Good Luck
BS"D

Steve Moss said:
I am not sure what you mean. The Reports i have are "Bosun" "CO" "COXN"
"DMEO". in the drop down menu of the Combo box i have the values "Bosun"
"CO" "COXN" "DMEO". If i want to view the "CO" Report i would select the
"CO" value. i dont have a specific Report name until i select it in
the
drop
down list.

:

Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
'************************************
' Enter here the report name, instead of the combo name
' strReportName = "Report Name"
'************************************
strReportName = [Combo4]
'******************************
' In the criteria you need to have
' "[FieldNameInThe Table]='" & Me![Combo4] & "'"
' ******************************
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If

--
Good Luck
BS"D


:

I followed the code in the link and an error comes up, the error
being
"RUN
TIME ERROR '424'
OBJECT REQUIRED".

the code i entered was:

Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = [Combo4]
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If
End Sub


on Debug it highlighted the "DoCmd line". i used [Combo4] as the report
name as i have a list of reports to choose from and the one i want
to
select
is defined by what is selected in the combo box. what am i doing wrong.


:

Look at this link on "Printing the Record on the Microsoft
Access
Form to a
Report"

http://www.databasedev.co.uk/report_from_form_record.html

In addition, if the filter is on a text field, change the filter adding
single quote for a string

This line:
strCriteria = "[lngSalespersonID]= " & Me![lngSalespersonID]

will turn into
strCriteria = "[lngSalespersonID]= '" & Me![lngSalespersonID] & "'"

--
Good Luck
BS"D


:

I have a form with 1 combo box on it. on the drop down menu
there
are a
number of names. when a specific name is selected how do i
get it
to open
thr report corresponding to that name i.e. when "Jane" is
selcted
from the
list, the report "jane opens"
 
I'd recommend adding a button and using that to launch the report, not
simply choosing something from the combo box:

Private Sub MyButton_Click()
Dim strReportName As String
Dim strCriteria As String

If IsNull(Me![Combo4]) Then
MsgBox "You must select a custodian.", _
vbInformation, "Invalid Action"
Else
strReportName = "NameOfReport"
strCriteria = "[Custodian] ='" & Me![Combo4] & "'"
DoComd.OpenReport strReportName, acViewPreview, ,strCriteria
End If

End Sub

This assumes that there's a field in your table named Custodian.

Note that since you're dealing with text data, that line is

strCriteria = "[Custodian] =' " & Me![Combo4] & " ' "

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Steve Moss said:
I think I am confusing myself. I think the best thing to do would be to
start again with this form. Mybe you could point me in the right
direction.
My whole database is centred around 1 Table. In this table I have lists
of
"Books of Reference". With different people i.e. "Bosun", "CO", "COXN"
and
"DMEO" being custodian for different books. I have created a query to
display the books belonging to each of these people, with a Report created
from each query. I would like to use 1 form with 1 Combobox on it to
select
which persons report I would like to look at. in the Row Source for the
Combobox i have "Bosun";"CO";"COXN";"DMEO" to choose from. how do i go
about
getting this combobox to work.

I hope that is a little easier to understand.
Cheers

Douglas J. Steele said:
It seems very strange that you have a field in the underlying recordset
named Combo4, which is what the criteria you've set indicates.

The syntax for the OpenReport method is:

DoCmd.OpenReport reportname[, view][, filtername][, wherecondition]

You're specifying a wherecondition, not a filter (filtername needs to be
the
valid name of a query in the current database), so you want

DoComd.OpenReport strReportName, acViewPreview, , strCriteria


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Steve Moss said:
I followed the code in the link and an error comes up, the error being
"RUN
TIME ERROR '424'
OBJECT REQUIRED".

the code i entered was:

Private Sub Combo4_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = [Combo4]
strCriteria = "[Combo4] =" & Me![Combo4] & ""
DoComd.OpenReport strReportName, acViewPreview, strCriteria
End If
End Sub


on Debug it highlighted the "DoCmd line". i used [Combo4] as the
report
name as i have a list of reports to choose from and the one i want to
select
is defined by what is selected in the combo box. what am i doing
wrong.


:

Look at this link on "Printing the Record on the Microsoft Access Form
to
a
Report"

http://www.databasedev.co.uk/report_from_form_record.html

In addition, if the filter is on a text field, change the filter
adding
single quote for a string

This line:
strCriteria = "[lngSalespersonID]= " & Me![lngSalespersonID]

will turn into
strCriteria = "[lngSalespersonID]= '" & Me![lngSalespersonID] & "'"

--
Good Luck
BS"D


:

I have a form with 1 combo box on it. on the drop down menu there
are
a
number of names. when a specific name is selected how do i get it
to
open
thr report corresponding to that name i.e. when "Jane" is selcted
from
the
list, the report "jane opens"
 

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

Access How Current page of a form Read Only 2
Open main and sub form blank 1
Filter combo on 2 columns 5
Add Numbers To A Listbox 3
combo box filter 1
Using data stored in a combo box 2
combo box locked 4
Combo Box 3

Back
Top