Please help with Coding a Form.

S

shar

I'm realively new to Access and I was hoping someone would help me with the
following:

I have created a database that links ODBC to another data source. I have
serveral reports each based on a particular ID number. I have created a
table that corresponds the ID number, query name and report name used in this
database.

What I want to accomplish is a form with a combo box to list the ID number
and have it print it's corresponding report. This form will be the opening
form (menu) for the end user. How would I go about this?

Any thoughts? and TIA
 
D

Damiaan

Put a combobox on your form.

Use the wizard or fill in the rowsource.
* change the "column count" and "column width" properties to the number you
want
* then change the event "after update".

Private Sub Supplier_SupplierGroup_ID_AfterUpdate()

doCmd.OpenReport "myformname",acViewPreview,,"Supplier_ID=" &
me.Supplier_ID

End Sub



--

Kind Regards
Damiaan
e: info at dampee.be
w: http://www.dampee.be
 
S

shar

Thank you for your help. I apologize about my ignorance in coding and that I
did not understand how to interpret your suggestion. I've been taking stabs
all day on this and I'm trying the following code. While I don't get any
debugging errors, I also don't get a report. Any ideas? Thank you.

Private Sub ID_AfterUpdate()
If Me.ID = "Table![t_LOOKUP]![Resource_ID]" Then
DoCmd.OpenReport "Table![t_LOOKUP]![Report]", acViewPreview
End If

End Sub
 
J

John Vinson

Thank you for your help. I apologize about my ignorance in coding and that I
did not understand how to interpret your suggestion. I've been taking stabs
all day on this and I'm trying the following code. While I don't get any
debugging errors, I also don't get a report. Any ideas? Thank you.

Private Sub ID_AfterUpdate()
If Me.ID = "Table![t_LOOKUP]![Resource_ID]" Then
DoCmd.OpenReport "Table![t_LOOKUP]![Report]", acViewPreview
End If

The Table! syntax is invalid and meaningless.

Did you try the suggested code? It does work. You might also want to
put the mouse on the word OpenReport and press F1 to get Access help.

John W. Vinson[MVP]
 
Top