access vba
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » Access VBA

Access VBA

resolvedResolved · Medium Priority · Version 2003

replyReply Tue 9 Jun 2009, 10:37Delegate Helen said...

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

For upcoming training course dates see: Pricing & availability

replyReply Wed 10 Jun 2009, 11:17Trainer Stephen said...

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.

 

Please browse our web site to find out more about
access database microsoft training and other Microsoft training courses.

Access tip:

Open A Combo Box Automatically

This is helpful if users need to enter large amounts of data. There are two ways to open ComboBoxes when they get the focus by using the tab keys.

When the ComboBox gets focus:

Press Alt + Down Arrow on the keyboard

For it to happen automatically, needs a bit of coding:

1. Add a combo box and a text box control to the form
2. Set the combo box's On Got Focus property to the following event procedure:

Private Sub ComboBoxName _GotFocus()

Me!ComboBoxName.Dropdown

End Sub


3. Open your form in Form View and use the TAB key to make sure it works.

View all Access hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard