Select Case and Tabular Forms

D

DoveArrow

It's a little complicated to explain what I want my end result to be,
but right now, I have a tabular form with a field that I want to use
to update an unbound text box, I've named Ability. In doing some tests
to see if this would work, I tried writing a really basic sequence:

Select Case [Ability ID]
Case 1
Ability = 1
Case 2
Ability = 2
Case 3
Ability = 3
Case 4
Ability = 4
Case 5
Ability = 5
Case 6
Ability = 6
End Select

The problem is, when I run this Select...Case statement, it only pulls
the number from the first field. Example: if I have four rows, with
the numbers 1, 2, 3, and 4 in Ability ID respectively, it popluates my
four Ability text boxes with the numbers 1, 1, 1, and 1. Is there a
way to get it to refer specifically to the Ability ID field in each
row?
 
M

missinglinq via AccessMonster.com

Putting aside, for the moment, why you'd want an unbound field based on a
bound field when they both hold the same value, are both [Ability ID] and
Ability numeric? And where do you have this code placed?
It's a little complicated to explain what I want my end result to be,
but right now, I have a tabular form with a field that I want to use
to update an unbound text box, I've named Ability. In doing some tests
to see if this would work, I tried writing a really basic sequence:

Select Case [Ability ID]
Case 1
Ability = 1
Case 2
Ability = 2
Case 3
Ability = 3
Case 4
Ability = 4
Case 5
Ability = 5
Case 6
Ability = 6
End Select

The problem is, when I run this Select...Case statement, it only pulls
the number from the first field. Example: if I have four rows, with
the numbers 1, 2, 3, and 4 in Ability ID respectively, it popluates my
four Ability text boxes with the numbers 1, 1, 1, and 1. Is there a
way to get it to refer specifically to the Ability ID field in each
row?
 
D

DoveArrow

Putting aside, for the moment, why you'd want an unbound field based on a
bound field when they both hold the same value, are both [Ability ID] and
Ability numeric? And where do you have this code placed?




It's a little complicated to explain what I want my end result to be,
but right now, I have a tabular form with a field that I want to use
to update an unbound text box, I've named Ability. In doing some tests
to see if this would work, I tried writing a really basic sequence:
Select Case [Ability ID]
Case 1
Ability = 1
Case 2
Ability = 2
Case 3
Ability = 3
Case 4
Ability = 4
Case 5
Ability = 5
Case 6
Ability = 6
End Select
The problem is, when I run this Select...Case statement, it only pulls
the number from the first field. Example: if I have four rows, with
the numbers 1, 2, 3, and 4 in Ability ID respectively, it popluates my
four Ability text boxes with the numbers 1, 1, 1, and 1. Is there a
way to get it to refer specifically to the Ability ID field in each
row?

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted viahttp://www.accessmonster.com- Hide quoted text -

- Show quoted text -

Like I said, this is just a basic test. Eventually, I want to put in a
more complicated calculation. In any case, both Ability ID and Ability
are numeric. The code that I wrote above is, for the moment, in the
OnCurrent section of my form.
 
D

DoveArrow

Putting aside, for the moment, why you'd want an unbound field based on a
bound field when they both hold the same value, are both [Ability ID] and
Ability numeric? And where do you have this code placed?
DoveArrow said:
It's a little complicated to explain what I want my end result to be,
but right now, I have a tabular form with a field that I want to use
to update an unbound text box, I've named Ability. In doing some tests
to see if this would work, I tried writing a really basic sequence:
Select Case [Ability ID]
Case 1
Ability = 1
Case 2
Ability = 2
Case 3
Ability = 3
Case 4
Ability = 4
Case 5
Ability = 5
Case 6
Ability = 6
End Select
The problem is, when I run this Select...Case statement, it only pulls
the number from the first field. Example: if I have four rows, with
the numbers 1, 2, 3, and 4 in Ability ID respectively, it popluates my
four Ability text boxes with the numbers 1, 1, 1, and 1. Is there a
way to get it to refer specifically to the Ability ID field in each
row?
Answers/posts based on Access 2000
Message posted viahttp://www.accessmonster.com-Hide quoted text -
- Show quoted text -

Like I said, this is just a basic test. Eventually, I want to put in a
more complicated calculation. In any case, both Ability ID and Ability
are numeric. The code that I wrote above is, for the moment, in the
OnCurrent section of my form.- Hide quoted text -

- Show quoted text -

Update: Nevermind. I figured out how to do what I wanted by putting a
Choose Function into my Select Query.
 
B

Beetle

It sounds like you're using a continuous form. If so that's the source of
your problem. Your code is only going to be applied to whatever record you
are currently on. So if the [AbilityID] of the current record is 1, then your
unbound text box is going to display 1 in all rows of the form. If you can,
change to a standard form.

If there is some reason why it must be a continous form, then you are going
to have to come up with another way of accomplishing what you want. You may
be able to create a query that uses an expression or criteria field to
determine the value you want. Then you could base your form on the query and
your [Ability] control on the expression/criteria field of the query. It's
hard to say for sure without knowing more about your situation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top