Reports from combo box

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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
 
Back
Top