Zoptooniek
New member
- Local time
- Today, 15:47
- Joined
- Jun 22, 2011
- Messages
- 4
Hi Experts,
I am using the forms.formname.fieldname syntax to control fields on a form. However, I have many of these fields and I don't wish to type code for every single one of them.
What I am trying to use is the ampersand to try to concatenate a number to each bit of code so I only need to write it once.
EG - 5 date fileds on the form - txtDate1, txtDate2, txtDate3 etc.....
Say I wanted to disable these fields but on separrate occassions, I don't want to type forms.formname.txtDate1, forms.formname.txtDate2, forms.formname,txtDate3 etc.....
I would like to pull a value from one of my fields also on this form (txtRow) and concatenate this value to the line of code.
EG
Dim Row As String
Row = Forms.formname.txtRow.Value
Forms.formname.txtDate " & Row &" = Date
instead of doing this.....
forms.formname,txtDate1 = Date
forms.formname,txtDate2 = Date
forms.formname,txtDate3 = Date
Is this actually achievable at all??
any help/advice would be greatly appreceated
I am using the forms.formname.fieldname syntax to control fields on a form. However, I have many of these fields and I don't wish to type code for every single one of them.
What I am trying to use is the ampersand to try to concatenate a number to each bit of code so I only need to write it once.
EG - 5 date fileds on the form - txtDate1, txtDate2, txtDate3 etc.....
Say I wanted to disable these fields but on separrate occassions, I don't want to type forms.formname.txtDate1, forms.formname.txtDate2, forms.formname,txtDate3 etc.....
I would like to pull a value from one of my fields also on this form (txtRow) and concatenate this value to the line of code.
EG
Dim Row As String
Row = Forms.formname.txtRow.Value
Forms.formname.txtDate " & Row &" = Date
instead of doing this.....
forms.formname,txtDate1 = Date
forms.formname,txtDate2 = Date
forms.formname,txtDate3 = Date
Is this actually achievable at all??
any help/advice would be greatly appreceated