Reports from combo box

G

Guest

Im doing a database about countries;

I want to create a combo box in form, when you select the dropdown list of
this combox box. You should see a list of countries, when you select for e.g
UK. A report should show me other information about UK.

So simply want to know how to create a report from a combox box from form.

Please help!
 
A

Anne

Create a form based on your table countries. The form must have at least
"YourCountyID" field. It does not have to be visible, but it is a good Idea
to have it visible along with the name so the user can see what they have
selected.
Create an unbound combobox to select the country.
Create a print button and put this in the on click event of the button:

Private Sub NameOfYourButton_Click()
Dim strWhere As String
strWhere = "True" ' so records will be retrieved if no other
' criteria are entered
If Not IsNull(Me!NameofyourComboBox) Then
strWhere = strWhere & " AND [YourCountryID] = " & Me!NameofYourComboBox
End If
DoCmd.OpenReport "NameofYourReport", acViewPreview, , strWhere
End Sub

I learned all that with the help of the people on this newsgroup
Anne
 

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