ACCESS reports

D

Duane Hookom

You normally shouldn't have multiple tables with the same or very similar
field structures. This suggests a non-normalized table structure. However,
you could place code in the On Open event of the report like:

Dim strTable As String
strTable = InputBox("Enter a table name") & ""
If Len(strTable) >0 then
Me.RecordSource = strTable
End If

A nice solution would have a combo box on a form that would contain a list
of record sources. Then your code might look like:
Dim strTable As String
strTable = Forms!frmA!cboRecordSource & ""
If Len(strTable) >0 then
Me.RecordSource = strTable
End If

Again, this is a somewhat unusual request.
 
B

bob Abraham

I have created a form and have it pulling the table names
using mSysObjects into both a combobox and a listbox. I
have tried both Bound and Unbound settings but am unable
to get either control to allow me to actually make a
selection. So that I can pass it as in the sample code
you sent below.

One other thing about your sample code, I also had to a
docmd.open in order to make sure the form was open first.

I know the combobox or listbox shouldn't be bound, but am
unable to get it to work at all. I've attempted putting a
simple msgbox on both the Click event and Change event,
but these events are never fired.

Any additional help would be greatly appreciated.
 

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