Combo box (as Parameter) to Show selected field/record

G

Guest

I have read all the other post with the same or similar problem as mine but
unfortunately they haven't worked for me as it has for others.
I trying to use a combo box as a parameter, to avoid typing the word(s), to
open a Report with the selected record (Field Name).

So far I created a Macro to run the "SpecificFieldName" Report once I have
selected a record from the combo box by using the following code for the
criteria in the query linked to the "SpecificFieldName" Report:

Like [Forms]![ReportsForm]![Combo10] & "*"

However, it shows me all the records instead of that one specific record
that I want to see. If I just use [Forms]![ReportsForm]![Combo10] the Report
comes out blank.

How can I fix this problem? Could the problem be caused due to the combo box
using a Select Distinct query by "FieldName" and not by "FieldID"?

Please help.

Thank you,
JRG
 
U

UpRider

JRG, it sounds like your criteria is evaluating to just "*" when you use the
asterisk, and you get all the records. This indicates that combo10 is null.
That would also explain why you get nothing when you don't include the
asterisk.
With the form open and combo10 filled in, try running the query by itself
and see what records it fetches. When you get
your query to work, the form should display the same records.

HTH, UpRider
 
G

Guest

UpRider,

I tried what you recommended (had the form open, combo10 filled in and ran
the query by itself) and nothing happened. The query returned a blank result
as if nothing has been selected. Furthermore, I still can't make the combo
box hold the selection I have made. Once I choose something, the box goes
blank as if nothing was selected.
The box is getting it's information from a query using the following code:
SELECT DISTINCT Standards.FieldName
FROM Standards;

I'm not including the PK (Standards.StandardsID) because it will create
duplicates in my combo box.

Thanks,

JRG


UpRider said:
JRG, it sounds like your criteria is evaluating to just "*" when you use the
asterisk, and you get all the records. This indicates that combo10 is null.
That would also explain why you get nothing when you don't include the
asterisk.
With the form open and combo10 filled in, try running the query by itself
and see what records it fetches. When you get
your query to work, the form should display the same records.

HTH, UpRider

JRG said:
I have read all the other post with the same or similar problem as mine but
unfortunately they haven't worked for me as it has for others.
I trying to use a combo box as a parameter, to avoid typing the word(s),
to
open a Report with the selected record (Field Name).

So far I created a Macro to run the "SpecificFieldName" Report once I have
selected a record from the combo box by using the following code for the
criteria in the query linked to the "SpecificFieldName" Report:

Like [Forms]![ReportsForm]![Combo10] & "*"

However, it shows me all the records instead of that one specific record
that I want to see. If I just use [Forms]![ReportsForm]![Combo10] the
Report
comes out blank.

How can I fix this problem? Could the problem be caused due to the combo
box
using a Select Distinct query by "FieldName" and not by "FieldID"?

Please help.

Thank you,
JRG
 
U

UpRider

JRG, like I said, your query for the form recordsource is returning nothing,
so the form is blank.
You have to get that query working.
As for your combobox, same thing. Get that rowsource query working in the
QBE grid.
BTW, if the combobox is strictly for lookup, it should not be bound to a
field in your table.

Work on this and get back if you have further problems,
UpRider

JRG said:
UpRider,

I tried what you recommended (had the form open, combo10 filled in and ran
the query by itself) and nothing happened. The query returned a blank
result
as if nothing has been selected. Furthermore, I still can't make the
combo
box hold the selection I have made. Once I choose something, the box goes
blank as if nothing was selected.
The box is getting it's information from a query using the following code:
SELECT DISTINCT Standards.FieldName
FROM Standards;

I'm not including the PK (Standards.StandardsID) because it will create
duplicates in my combo box.

Thanks,

JRG


UpRider said:
JRG, it sounds like your criteria is evaluating to just "*" when you use
the
asterisk, and you get all the records. This indicates that combo10 is
null.
That would also explain why you get nothing when you don't include the
asterisk.
With the form open and combo10 filled in, try running the query by itself
and see what records it fetches. When you get
your query to work, the form should display the same records.

HTH, UpRider

JRG said:
I have read all the other post with the same or similar problem as mine
but
unfortunately they haven't worked for me as it has for others.
I trying to use a combo box as a parameter, to avoid typing the
word(s),
to
open a Report with the selected record (Field Name).

So far I created a Macro to run the "SpecificFieldName" Report once I
have
selected a record from the combo box by using the following code for
the
criteria in the query linked to the "SpecificFieldName" Report:

Like [Forms]![ReportsForm]![Combo10] & "*"

However, it shows me all the records instead of that one specific
record
that I want to see. If I just use [Forms]![ReportsForm]![Combo10] the
Report
comes out blank.

How can I fix this problem? Could the problem be caused due to the
combo
box
using a Select Distinct query by "FieldName" and not by "FieldID"?

Please help.

Thank you,
JRG
 
G

Guest

UpRider,
I was able to make the combo box hold the selection I made, but I continue
to have a problem with making the combo box and the query correlate.
I have used [Forms]![ReportsForm]![Combo10], adn Like
[Forms]![ReportsForm]![Combo10] & "*", yet I still get a blank result.

The combo box is now bound to a query and no longer to a table.
I am really stuck at this point.

Thanks,
JRG


UpRider said:
JRG, like I said, your query for the form recordsource is returning nothing,
so the form is blank.
You have to get that query working.
As for your combobox, same thing. Get that rowsource query working in the
QBE grid.
BTW, if the combobox is strictly for lookup, it should not be bound to a
field in your table.

Work on this and get back if you have further problems,
UpRider

JRG said:
UpRider,

I tried what you recommended (had the form open, combo10 filled in and ran
the query by itself) and nothing happened. The query returned a blank
result
as if nothing has been selected. Furthermore, I still can't make the
combo
box hold the selection I have made. Once I choose something, the box goes
blank as if nothing was selected.
The box is getting it's information from a query using the following code:
SELECT DISTINCT Standards.FieldName
FROM Standards;

I'm not including the PK (Standards.StandardsID) because it will create
duplicates in my combo box.

Thanks,

JRG


UpRider said:
JRG, it sounds like your criteria is evaluating to just "*" when you use
the
asterisk, and you get all the records. This indicates that combo10 is
null.
That would also explain why you get nothing when you don't include the
asterisk.
With the form open and combo10 filled in, try running the query by itself
and see what records it fetches. When you get
your query to work, the form should display the same records.

HTH, UpRider

I have read all the other post with the same or similar problem as mine
but
unfortunately they haven't worked for me as it has for others.
I trying to use a combo box as a parameter, to avoid typing the
word(s),
to
open a Report with the selected record (Field Name).

So far I created a Macro to run the "SpecificFieldName" Report once I
have
selected a record from the combo box by using the following code for
the
criteria in the query linked to the "SpecificFieldName" Report:

Like [Forms]![ReportsForm]![Combo10] & "*"

However, it shows me all the records instead of that one specific
record
that I want to see. If I just use [Forms]![ReportsForm]![Combo10] the
Report
comes out blank.

How can I fix this problem? Could the problem be caused due to the
combo
box
using a Select Distinct query by "FieldName" and not by "FieldID"?

Please help.

Thank you,
JRG
 
U

UpRider

OK, let's get some details. 8 items.
For Combo10 Property Sheet FORMAT
What is in
-Column Count
-Column Widths
For Combo10 Property Sheet DATA
What is in
-Control Source
-Row Source
-Row Source Type
-Bound Column
Property Sheet DATA for the form containing Combo10
What is in
-Recordsource
-And finally, the name of the form containing Combo10

UpRider

JRG said:
UpRider,
I was able to make the combo box hold the selection I made, but I continue
to have a problem with making the combo box and the query correlate.
I have used [Forms]![ReportsForm]![Combo10], adn Like
[Forms]![ReportsForm]![Combo10] & "*", yet I still get a blank result.

The combo box is now bound to a query and no longer to a table.
I am really stuck at this point.

Thanks,
JRG


UpRider said:
JRG, like I said, your query for the form recordsource is returning
nothing,
so the form is blank.
You have to get that query working.
As for your combobox, same thing. Get that rowsource query working in the
QBE grid.
BTW, if the combobox is strictly for lookup, it should not be bound to a
field in your table.

Work on this and get back if you have further problems,
UpRider

JRG said:
UpRider,

I tried what you recommended (had the form open, combo10 filled in and
ran
the query by itself) and nothing happened. The query returned a blank
result
as if nothing has been selected. Furthermore, I still can't make the
combo
box hold the selection I have made. Once I choose something, the box
goes
blank as if nothing was selected.
The box is getting it's information from a query using the following
code:
SELECT DISTINCT Standards.FieldName
FROM Standards;

I'm not including the PK (Standards.StandardsID) because it will create
duplicates in my combo box.

Thanks,

JRG


:

JRG, it sounds like your criteria is evaluating to just "*" when you
use
the
asterisk, and you get all the records. This indicates that combo10 is
null.
That would also explain why you get nothing when you don't include the
asterisk.
With the form open and combo10 filled in, try running the query by
itself
and see what records it fetches. When you get
your query to work, the form should display the same records.

HTH, UpRider

I have read all the other post with the same or similar problem as
mine
but
unfortunately they haven't worked for me as it has for others.
I trying to use a combo box as a parameter, to avoid typing the
word(s),
to
open a Report with the selected record (Field Name).

So far I created a Macro to run the "SpecificFieldName" Report once
I
have
selected a record from the combo box by using the following code for
the
criteria in the query linked to the "SpecificFieldName" Report:

Like [Forms]![ReportsForm]![Combo10] & "*"

However, it shows me all the records instead of that one specific
record
that I want to see. If I just use [Forms]![ReportsForm]![Combo10]
the
Report
comes out blank.

How can I fix this problem? Could the problem be caused due to the
combo
box
using a Select Distinct query by "FieldName" and not by "FieldID"?

Please help.

Thank you,
JRG
 
G

Guest

UpRider,
Thank you for your help. I appreciate the time you have dedicated in helping
me.
I found the solution. I kept the criteria ([Forms]![ReportsForm]![Combo10])
for the "fieldname" in the query. In stead of using a macro to run after
update of my combo box I used the following code:

Dim stDocName As String
Dim stlinkcriteria As String

stDocName = "[NameofReport]"

stlinkcriteria = "[FieldName]=" & Me![Combo10]
DoCmd.OpenReport stDocName, acPreview

I also changed the bound column from 0 to 1 and the Limit to List from yes
to no...and long behold it worked!!
I not shore if it was the VBA that did the trick but I'm sure changing the
bound column and the Limit to List had a lot to do with it.

Thank you once again,

JRG


UpRider said:
OK, let's get some details. 8 items.
For Combo10 Property Sheet FORMAT
What is in
-Column Count
-Column Widths
For Combo10 Property Sheet DATA
What is in
-Control Source
-Row Source
-Row Source Type
-Bound Column
Property Sheet DATA for the form containing Combo10
What is in
-Recordsource
-And finally, the name of the form containing Combo10

UpRider

JRG said:
UpRider,
I was able to make the combo box hold the selection I made, but I continue
to have a problem with making the combo box and the query correlate.
I have used [Forms]![ReportsForm]![Combo10], adn Like
[Forms]![ReportsForm]![Combo10] & "*", yet I still get a blank result.

The combo box is now bound to a query and no longer to a table.
I am really stuck at this point.

Thanks,
JRG


UpRider said:
JRG, like I said, your query for the form recordsource is returning
nothing,
so the form is blank.
You have to get that query working.
As for your combobox, same thing. Get that rowsource query working in the
QBE grid.
BTW, if the combobox is strictly for lookup, it should not be bound to a
field in your table.

Work on this and get back if you have further problems,
UpRider

UpRider,

I tried what you recommended (had the form open, combo10 filled in and
ran
the query by itself) and nothing happened. The query returned a blank
result
as if nothing has been selected. Furthermore, I still can't make the
combo
box hold the selection I have made. Once I choose something, the box
goes
blank as if nothing was selected.
The box is getting it's information from a query using the following
code:
SELECT DISTINCT Standards.FieldName
FROM Standards;

I'm not including the PK (Standards.StandardsID) because it will create
duplicates in my combo box.

Thanks,

JRG


:

JRG, it sounds like your criteria is evaluating to just "*" when you
use
the
asterisk, and you get all the records. This indicates that combo10 is
null.
That would also explain why you get nothing when you don't include the
asterisk.
With the form open and combo10 filled in, try running the query by
itself
and see what records it fetches. When you get
your query to work, the form should display the same records.

HTH, UpRider

I have read all the other post with the same or similar problem as
mine
but
unfortunately they haven't worked for me as it has for others.
I trying to use a combo box as a parameter, to avoid typing the
word(s),
to
open a Report with the selected record (Field Name).

So far I created a Macro to run the "SpecificFieldName" Report once
I
have
selected a record from the combo box by using the following code for
the
criteria in the query linked to the "SpecificFieldName" Report:

Like [Forms]![ReportsForm]![Combo10] & "*"

However, it shows me all the records instead of that one specific
record
that I want to see. If I just use [Forms]![ReportsForm]![Combo10]
the
Report
comes out blank.

How can I fix this problem? Could the problem be caused due to the
combo
box
using a Select Distinct query by "FieldName" and not by "FieldID"?

Please help.

Thank you,
JRG
 
U

UpRider

Glad you got it working. It was the bound column for sure.

UpRider

JRG said:
UpRider,
Thank you for your help. I appreciate the time you have dedicated in
helping
me.
I found the solution. I kept the criteria
([Forms]![ReportsForm]![Combo10])
for the "fieldname" in the query. In stead of using a macro to run after
update of my combo box I used the following code:

Dim stDocName As String
Dim stlinkcriteria As String

stDocName = "[NameofReport]"

stlinkcriteria = "[FieldName]=" & Me![Combo10]
DoCmd.OpenReport stDocName, acPreview

I also changed the bound column from 0 to 1 and the Limit to List from yes
to no...and long behold it worked!!
I not shore if it was the VBA that did the trick but I'm sure changing the
bound column and the Limit to List had a lot to do with it.

Thank you once again,

JRG


UpRider said:
OK, let's get some details. 8 items.
For Combo10 Property Sheet FORMAT
What is in
-Column Count
-Column Widths
For Combo10 Property Sheet DATA
What is in
-Control Source
-Row Source
-Row Source Type
-Bound Column
Property Sheet DATA for the form containing Combo10
What is in
-Recordsource
-And finally, the name of the form containing Combo10

UpRider

JRG said:
UpRider,
I was able to make the combo box hold the selection I made, but I
continue
to have a problem with making the combo box and the query correlate.
I have used [Forms]![ReportsForm]![Combo10], adn Like
[Forms]![ReportsForm]![Combo10] & "*", yet I still get a blank result.

The combo box is now bound to a query and no longer to a table.
I am really stuck at this point.

Thanks,
JRG


:

JRG, like I said, your query for the form recordsource is returning
nothing,
so the form is blank.
You have to get that query working.
As for your combobox, same thing. Get that rowsource query working in
the
QBE grid.
BTW, if the combobox is strictly for lookup, it should not be bound to
a
field in your table.

Work on this and get back if you have further problems,
UpRider

UpRider,

I tried what you recommended (had the form open, combo10 filled in
and
ran
the query by itself) and nothing happened. The query returned a
blank
result
as if nothing has been selected. Furthermore, I still can't make
the
combo
box hold the selection I have made. Once I choose something, the
box
goes
blank as if nothing was selected.
The box is getting it's information from a query using the following
code:
SELECT DISTINCT Standards.FieldName
FROM Standards;

I'm not including the PK (Standards.StandardsID) because it will
create
duplicates in my combo box.

Thanks,

JRG


:

JRG, it sounds like your criteria is evaluating to just "*" when
you
use
the
asterisk, and you get all the records. This indicates that combo10
is
null.
That would also explain why you get nothing when you don't include
the
asterisk.
With the form open and combo10 filled in, try running the query by
itself
and see what records it fetches. When you get
your query to work, the form should display the same records.

HTH, UpRider

I have read all the other post with the same or similar problem as
mine
but
unfortunately they haven't worked for me as it has for others.
I trying to use a combo box as a parameter, to avoid typing the
word(s),
to
open a Report with the selected record (Field Name).

So far I created a Macro to run the "SpecificFieldName" Report
once
I
have
selected a record from the combo box by using the following code
for
the
criteria in the query linked to the "SpecificFieldName" Report:

Like [Forms]![ReportsForm]![Combo10] & "*"

However, it shows me all the records instead of that one specific
record
that I want to see. If I just use
[Forms]![ReportsForm]![Combo10]
the
Report
comes out blank.

How can I fix this problem? Could the problem be caused due to
the
combo
box
using a Select Distinct query by "FieldName" and not by
"FieldID"?

Please help.

Thank you,
JRG
 

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


Top