Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

access vba

ResolvedVersion 2003

Helen has attended:
Access VBA course

Access VBA

When producing reports from our invoicing database - for some fields the output shows the primary key ID number rather than the contents of the TABLE/QUERY. This only happens when the item in the table is a lookup e.g. to lookup supplier names.
I got around this problem by deleting the ID column and changing the primary key in the relevant table to the field we wanted to show on the report e.g. the supplier name field.
I would like to know if it

RE: Access VBA

Hi Helen

Thank you for your question

Ideally, the best solution is to display the relevant fields in a combo box on the form and hide the key column. This is done by specifying that the combo should show both the id filed and the supplier name field. Do this by setting the rowsource property to

"SELECT ID,Supplier Name FROM SupplierTable"

Then set the columncount property to 2, and the columnwidths property to "0cm;5cm". This will result in a combo box that just displays the supplier name.

Hope this helps

Regards

Stephen

Thu 18 Jun 2009: Automatically marked as resolved.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Access tip:

Duplicating an Entry

To duplicate the entry press CTRL+' (apostrophe)this will copy the contents of the previous entry in the same field.
(Table view, line above) note this also works in Excel.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.13 secs.