List Box in a Dialog Form

S

S Jackson

I have created a dialog form containing a list box named RptListBox.
The list box is from tblReports which contains 2 fields: RptName and
ActualName.

RptName is a user-friendly name for the report
ActualName is the actual name of the report in the db.

I want a cmd button that the user will click after they select a report that
will preview the report.

I've tried this (per someone else's advice here):

DoCmd.OpenReport RptListBox, acPreview

The error is: The expression you entered is the wrong data type for one of
the arguments.

I know I need to set some sort of variable, but I'm just learning and don't
know how.

TIA
S. Jackson
 
D

Dan Artuso

Hi,
Is your listbox set up so that your 1st column contains the ActualName, is the bound column
and hidden? I would think it would work if set up this way.
 
A

Albert D. Kallal

The Actual report name should be the first column. If you wish, you can set
the length of the first column in the listbox to 0, and it will not show.

Also make sure that properties sheet for the list box has the bound column
set to 1 if you choose the above approach.

You code looks ok...

DoCmd.OpenReport RptListBox, acPreview

Also, is the listbox un-bound (it should be).
 

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

Similar Threads

Report List Box 1
Requery Method 1
2 List Boxes-1 Form 1
Save dialog box 2
More Help Needed - Report Objects 3
Help with strSQL 12
Msg box help 1
print to pdf without prompt or dialog box 2

Top