recordset problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This code works except if I move to the next record and the grade field
changes in the record to a different level. The text goal field remains the
same as the first record grade level. The txtGoal.text should change
according to the respective case for each record.

Select Case [Grade]
Case "5"
[txtGoal] = "30"
Case "4"
[txtGoal] = "25"
Case "3"
[txtGoal] = "20"
End Select

Thanks,
 
Where is your code? Are you calling it from the On Current event of your
form?

Is txtGoal bound to a field? Is there a reason why the Grade and Goal are
"hard-coded" in your module? This looks like you should have a table with
the grade and goal.
 
txtGoal is not bound, but the grade.text is bound to a table.

The code resides in the cbo afterupdate event.

I guess I could add another field to the 8 separate tables and solve the
problem that way. It just seemed easier with a few lines of code.

Duane Hookom said:
Where is your code? Are you calling it from the On Current event of your
form?

Is txtGoal bound to a field? Is there a reason why the Grade and Goal are
"hard-coded" in your module? This looks like you should have a table with
the grade and goal.

--
Duane Hookom
MS Access MVP
--

GM said:
This code works except if I move to the next record and the grade field
changes in the record to a different level. The text goal field remains
the
same as the first record grade level. The txtGoal.text should change
according to the respective case for each record.

Select Case [Grade]
Case "5"
[txtGoal] = "30"
Case "4"
[txtGoal] = "25"
Case "3"
[txtGoal] = "20"
End Select

Thanks,
 
Call the cbo afterupdate event procedure from the On Current Event of the
form.

I am afraid to ask why you would need to add a field to 8 separate tables.

--
Duane Hookom
MS Access MVP
--

GM said:
txtGoal is not bound, but the grade.text is bound to a table.

The code resides in the cbo afterupdate event.

I guess I could add another field to the 8 separate tables and solve the
problem that way. It just seemed easier with a few lines of code.

Duane Hookom said:
Where is your code? Are you calling it from the On Current event of your
form?

Is txtGoal bound to a field? Is there a reason why the Grade and Goal are
"hard-coded" in your module? This looks like you should have a table with
the grade and goal.

--
Duane Hookom
MS Access MVP
--

GM said:
This code works except if I move to the next record and the grade field
changes in the record to a different level. The text goal field remains
the
same as the first record grade level. The txtGoal.text should change
according to the respective case for each record.

Select Case [Grade]
Case "5"
[txtGoal] = "30"
Case "4"
[txtGoal] = "25"
Case "3"
[txtGoal] = "20"
End Select

Thanks,
 
After calling the code on current event the procedure worked.
Thanks

Duane Hookom said:
Call the cbo afterupdate event procedure from the On Current Event of the
form.

I am afraid to ask why you would need to add a field to 8 separate tables.

--
Duane Hookom
MS Access MVP
--

GM said:
txtGoal is not bound, but the grade.text is bound to a table.

The code resides in the cbo afterupdate event.

I guess I could add another field to the 8 separate tables and solve the
problem that way. It just seemed easier with a few lines of code.

Duane Hookom said:
Where is your code? Are you calling it from the On Current event of your
form?

Is txtGoal bound to a field? Is there a reason why the Grade and Goal are
"hard-coded" in your module? This looks like you should have a table with
the grade and goal.

--
Duane Hookom
MS Access MVP
--

This code works except if I move to the next record and the grade field
changes in the record to a different level. The text goal field remains
the
same as the first record grade level. The txtGoal.text should change
according to the respective case for each record.

Select Case [Grade]
Case "5"
[txtGoal] = "30"
Case "4"
[txtGoal] = "25"
Case "3"
[txtGoal] = "20"
End Select

Thanks,
 
Back
Top