Searching for info

G

Guest

I have a main database "BR Accounts" containing books of reference and there
custodain. from this I have produced a For to input data onto the table, a
query and from the query a report showing the information I have inputted. I
also have a table "Custodian". This is where I enter new custodians so I can
select them on the "BR Accounts" by using a combobox. I have another Form
"Select" where I have a combobox from which I select a persons name. this
information I wish to use as a filter to filter the "BR Account" and display
only the persons holding I have selected. I have been using the following
code and it does not seem to work.

Private Sub Combo0_AfterUpdate()
If Len(Trim(Me![Combo0]) & "") > 0 Then
DoCmd.OpenReport "BR Account Report", acViewPreview,, "Custodian" = '" &
Me![Combo0].Value. & "'"
Else
MsgBox "You need to select a person"
End If
End Sub

Combo0 = the Combobox I use to select the desired name for filtering
BR Account Report = the finished report
Custodian = the filed I wish the field where the persons name is stored.

I can get the report to display but there isnt any information on it. I
have had this working before on another system but have lost the database so
need to do it again
 
G

George Nicholson

Try:

...."Custodian = '" & Me![Combo0].Value & "'"

-Remove trailing " after "Custodian"
-Remove trailing . after Value.

HTH,
 
G

Guest

That doesnt seem to work. It opens the report, bujt without any filtered
information.

George Nicholson said:
Try:

...."Custodian = '" & Me![Combo0].Value & "'"

-Remove trailing " after "Custodian"
-Remove trailing . after Value.

HTH,

Steve Moss said:
I have a main database "BR Accounts" containing books of reference and
there
custodain. from this I have produced a For to input data onto the table,
a
query and from the query a report showing the information I have inputted.
I
also have a table "Custodian". This is where I enter new custodians so I
can
select them on the "BR Accounts" by using a combobox. I have another Form
"Select" where I have a combobox from which I select a persons name. this
information I wish to use as a filter to filter the "BR Account" and
display
only the persons holding I have selected. I have been using the following
code and it does not seem to work.

Private Sub Combo0_AfterUpdate()
If Len(Trim(Me![Combo0]) & "") > 0 Then
DoCmd.OpenReport "BR Account Report", acViewPreview,, "Custodian" = '" &
Me![Combo0].Value. & "'"
Else
MsgBox "You need to select a person"
End If
End Sub

Combo0 = the Combobox I use to select the desired name for filtering
BR Account Report = the finished report
Custodian = the filed I wish the field where the persons name is stored.

I can get the report to display but there isnt any information on it. I
have had this working before on another system but have lost the database
so
need to do it again
 

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