Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Have one field's value change other fields

Status
Not open for further replies.

clickster

MIS
Feb 19, 2002
89
US
I have 66 fields on my form (I know I know, that's far too many, but I'll have to deal with that at a later time). Anyway, we're going to call the first field PrimaryField and the rest of the fields will be names sequentially as 001, 002,...,064, 065. They are all combo boxes. When I select one of my options in PrimaryField, I want 001-065 to all have that value. So if I select Option 1 in PrimaryField, the other 65 fields should change to Option 1. If I change to Option 2, they should all change to Option 2. If there is any way to do this without VBA, it would be great, though I know that VBA may be a necessity here. Thank you in advance for any help.
 
The only way I can think of doing this is by setting the criteria for each of the combo boxes columns to the Primary Field's value.

I.e. SELECT column1, column2 FROM table1 WHERE column2 = Forms!frmName!PrimaryField

Then in VBA make sure you refresh each of the combo boxes after PrimaryField's combo box is changed.
 
That should do the trick. Thank you for your help. The only thing I'm nost sure about is the VBA since I don't know any yet (should start learning that in about a week once my book arrives). Do you think that a Requery macro would do the trick if I set it "on update" on the PrimaryField?
 
All you need to do in the VBA is this...

in PrimaryField's AfterUpdate event...

me.001.requery
me.002.requery
me.003.requery
(and so on)
 
Perfect. Thanks for the help. that should definitely solve my problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top