auto populate fields
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training add this page to your favourites/bookmarksBookmark page

view a printable version of this pagePrintable version
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Access Training and help » Auto populate fields

Auto populate fields

The UK's most regular instructor-led training courses.
Training information: access class ms training · Courses in microsoft access · Microsoft Access Training uk
See also · microsoft access training · access vba courses · access database course

resolvedResolved · Low Priority · Version 2003

No ranking yet
6 posts
replyReplySun 7 Feb 2010, 18:03Delegate Tony said...

Auto populate fields

I am using a form to add new records. The first field is populated using a combox that takes its values from another table. The value of this field will be the same in a series of enteries so I want to auto populate it based on the last record. I have added a line of code to set a varialble the first time the value is selected in the combobox and then tried to set the default value with the variable name in the properties window. However, I am not sure how to put a varaible name in the expression builder as it does not seem to recognise the name.

Access Advanced 1 day course
Version Date Location Places
available
Book Next place rate (£)
Pay by
Card
Pay by
Invoice
2003 Fri 19 Mar 2010 Bloomsbury 4 Book now £235 £240
2007 Wed 24 Mar 2010 Bloomsbury 5 Book now £240 £245
2003 Tue 6 Apr 2010 Southwark 9 Book now £203 £208
2007 Thu 13 May 2010 Bloomsbury 7 Book now £188 £193
2003 Tue 18 May 2010 Bloomsbury 9 Book now £182 £187
2003 Fri 2 Jul 2010 Bloomsbury 7 Book now £85 £90
Full Schedule: See all 11 Access Advanced course dates.
Bookings currently available until 14th December 2010.

Platinum
755 posts
replyReplyFri 12 Feb 2010, 16:28Trainer Stephen said...

RE: Auto populate fields

Hi Tony

Thanks for your question

You are trying to accomplish something that requires VBA code that runs when you update the first combo box. It will have to create an SQL string, with the variable embedded in it, and then sets the second combos row source property equal to it.
You cannot use the expression builder to accomplish task

Regards

Stephen


Related articles

· Happy Table Relationships In Access 2007
· When To Use Access, When To Use Excel
· How much time could you save with Access?
· Have You Ever Wanted To Create A Combo Control On An Access Form?
· User-Proofing Your Access Database: Part 2

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

Access tip:

Hiding Multiple Table columns

If you want to hide non-adjacent Access table columns. In Datasheet view, open the table that contains the columns you want to hide.

On the Format menu, click Unhide Columns.
In the Unhide Columns dialog box, clear the check box next to the name of each column you want to hide.
Click Close.

This method makes having to use the Hide Columns command repeatedly unnecessary

View all Access hints and tips


Rate this page:
2.1/5 (108 votes cast)
Institute of IT Training - Accredited Training Provider ILM
Microsoft Certified Partner
Microsoft Office Specialist Authorised Testing Centre (MOS and MCAS)

Prodigy Platinum Learning Partner

Institute of IT Training - Accredited Training Provider
McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams
Association of Computer Trainers verified by visa, mastercard securecard