auto populate fields

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

Auto populate fields

resolvedResolved · Low Priority · Version 2003

Tony has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course
Access Intermediate course
Access Advanced course

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.

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


 

Access tip:

Dsum

You can create percentage values based on individual products / items by using a Dsum function (used with a grouped query)

[Each value column] / Dsum[field:total for the column needed to be calculated],[tablename]

View all Access hints and tips


Server loaded in 0.09 secs.