By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,819 Members | 1,459 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,819 IT Pros & Developers. It's quick & easy.

Assign a symbolic name to a field with a value

P: 2
I work with VBA in Access 2003
My question: field func contains a value entered by user.
How can I get a symbolic name e.g. f1 if the value is 1, f2 if thw value is 2, and so on
2 Weeks Ago #1
Share this Question
Share on Google+
4 Replies

Expert Mod 15k+
P: 31,470
If it really is a Field then it already has a reference value to use - the field name.

Frankly, you include so little context in the question it's very hard to know what you're asking for.
2 Weeks Ago #2

Expert Mod 15k+
P: 31,470
Unless you're looking for the Enum statement maybe?
There would have to be a predetermined set of values that you assign names to but that might do you.

Access 2003 has a decent Help system so just type Enum and press F1 to get all you need on it.

If that's not what you want then you'll need to explain more clearly what you're actually asking about.
2 Weeks Ago #3

P: 2
I found a solution:
Expand|Select|Wrap|Line Numbers
  1. DIM checkFld AS String
  2. DIM checkBank AS Boolean
  3. DIM checkAccount as Boolean
  4. ...
  5. If checkFld = "Bank"THEN
  6. checkBank = TRUE
  7. ...
So I can use later in Source Code:
Expand|Select|Wrap|Line Numbers
  1. If checkBank THEN 
That's what I wanted
2 Weeks Ago #4

Expert Mod 15k+
P: 31,470
So you're looking for something like :
Expand|Select|Wrap|Line Numbers
  1. checkBank = (checkFld = "Bank")
  2. checkAccount = (checkFld = "Account")
  3. blah blah blah
  4. If checkBank Then
You possibly should have said as much in your question. There's no hint there that was what you were after. Also, not sure where that would ever be of benefit (It seems like something to avoid generally but I don't know your system so can't say for sure).

Anyway, glad you've found what you wanted anyway.
2 Weeks Ago #5

Post your reply

Sign in to post your reply or Sign up for a free account.