KeithWilliams
Registered User.
- Local time
- Today, 06:41
- Joined
- Feb 9, 2004
- Messages
- 137
Hi,
My first post!
I have a form which is initially unbound, but then I assign a record set to it in the Open event as follows:
2 of the fields in the form have names corresponding to the field names in the query referenced by rst. So I guess that makes it a bound form from that point on.
The form also includes an unbound control (with blank control source, and name which does not correspond to a field in the recordset).
The view of this form is Continuous Forms. It always displays 12 rows, one for each month of the year. I want to populate the unbound control with a different value for each month in the VBA code, but how do I do this? I want to say something like:
etc.
But I don't know how to reference the value in each row distinctly. If I assign a value to Me!UnboundField.Value then that value is assigned to all 12 rows!
I have a hideous workaround, based on setting the unbound field's control source to a CHOOSE statement based on the month, but I'm sure this isn't the "proper" way to do it.
Many thanks,
Keith.
My first post!
I have a form which is initially unbound, but then I assign a record set to it in the Open event as follows:
Code:
Set Me.Recordset = rst
The form also includes an unbound control (with blank control source, and name which does not correspond to a field in the recordset).
The view of this form is Continuous Forms. It always displays 12 rows, one for each month of the year. I want to populate the unbound control with a different value for each month in the VBA code, but how do I do this? I want to say something like:
Code:
Me!UnboundField.Value[1] = JanuaryValue
Me!UnboundField.Value[2] = FebruaryValue
But I don't know how to reference the value in each row distinctly. If I assign a value to Me!UnboundField.Value then that value is assigned to all 12 rows!
I have a hideous workaround, based on setting the unbound field's control source to a CHOOSE statement based on the month, but I'm sure this isn't the "proper" way to do it.
Many thanks,
Keith.