T
Todd
I have an unusual need for my database. I need to store form field names
inside a table. Let's say I have tblFields and one field name is
txtFieldName. I'm going to type in the field names of several checkbox
fields found on form frmPrintApps into txtFieldName. For example, the
values might be chkDocument1, chkDocument2, chkDocument3, etc. All of the
names of the checkbox fields found on my form will be stored into
txtFieldName.
Now, I want to be able to use txtFieldName in my code but how do I call on
it as a field instead of just text? For example, I want to call on it like
this:
If Me!chkDocument1 = True Then ... 'Print the document
Instead, however, I want to call on it from the txtFieldName. Of course, I
can't do this:
If txtFieldName = True Then ... 'Print the document
because that looks at the text in the record rather than realizing the text
is referring to a field name.
The end result I'm looking for is to loop through all my checkboxes on a
form and for each one that is checked, the code will open a corresponding
document. I sure hope you followed that because I'm almost confusing myself
trying to explain what I want to do.
Thanks!!!!
inside a table. Let's say I have tblFields and one field name is
txtFieldName. I'm going to type in the field names of several checkbox
fields found on form frmPrintApps into txtFieldName. For example, the
values might be chkDocument1, chkDocument2, chkDocument3, etc. All of the
names of the checkbox fields found on my form will be stored into
txtFieldName.
Now, I want to be able to use txtFieldName in my code but how do I call on
it as a field instead of just text? For example, I want to call on it like
this:
If Me!chkDocument1 = True Then ... 'Print the document
Instead, however, I want to call on it from the txtFieldName. Of course, I
can't do this:
If txtFieldName = True Then ... 'Print the document
because that looks at the text in the record rather than realizing the text
is referring to a field name.
The end result I'm looking for is to loop through all my checkboxes on a
form and for each one that is checked, the code will open a corresponding
document. I sure hope you followed that because I'm almost confusing myself
trying to explain what I want to do.
Thanks!!!!