Hello,
a bit convoluted this one, but I suspect I'm just doing something stupid...
I'm putting together a form which generates a selection of random values in text boxes, based on the content of a combobox (also on the form). One of the text boxes, though, requires only a yes or a no and I'm trying to generate that value as follows;
Code in the After Update event of the combo-box:
The idea being, when you change the combo-box value, the value in Text16 is set randomly to yes or no. Unfortunately, it won't work, as I keep getting the error:
I've tried referring to Text16 as [FormName]![Text16] and as [Forms]![FormName]![Text16] but I get the same error, saying that the first object (i.e. FormName or Forms) macro can't be found...
I'm sure this is down to me not knowing how to refer to objects on a form properly, so if anybody can help out, I'd be very grateful.
Thanks,
Paul
a bit convoluted this one, but I suspect I'm just doing something stupid...
I'm putting together a form which generates a selection of random values in text boxes, based on the content of a combobox (also on the form). One of the text boxes, though, requires only a yes or a no and I'm trying to generate that value as follows;
Code in the After Update event of the combo-box:
Code:
Text16.[Value]=IIf(Int(Rnd()*10)>5,"yes","no")
The idea being, when you change the combo-box value, the value in Text16 is set randomly to yes or no. Unfortunately, it won't work, as I keep getting the error:
Code:
Microsoft Office Access cannot find the macro 'Text16.'
I've tried referring to Text16 as [FormName]![Text16] and as [Forms]![FormName]![Text16] but I get the same error, saying that the first object (i.e. FormName or Forms) macro can't be found...
I'm sure this is down to me not knowing how to refer to objects on a form properly, so if anybody can help out, I'd be very grateful.
Thanks,
Paul