pick field based on number of clicks

megamef

Registered User.
Local time
Today, 22:13
Joined
Apr 18, 2013
Messages
161
Hi All,

This is simple task but I can't get my head round it.

I'm incrementing a counter every time I click on a combobox by using the on click event and this code:

Code:
POcount = POcount + 1

I have 5 fields on my form: GWS1, GWS2, GWS3, GWS4 and GWS5.

I want to store the value of the combobox when clicked into the correct GWS field.

For example: If I click the combobox 3 times it would store the value of the combobox after the 1st click in GWS1, after the 2nd click in GWS2 after the 3rd click in GWS3.

I tried
Code:
me."GWS & POcount" = combobox1
but that's invalid syntax.

Cheers

Steve
 
I would put parenthesis around your string. And I would make sure the string value is a valid control.

"GWS & POcount"

If you print that out, you will see "GWS & POcount" on your screen. If the variable POcount=1 and you want "GWS1" to print on your screen you would use this:

"GWS" & POcount
 
Me("GWS" & POcount)
 
Thanks Guys,

pbaldy that's exactly what I needed. I tried everything but I would never have removed the "." from the "me." so would never have chanced upon that.

Cheers
 

Users who are viewing this thread

Back
Top Bottom