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

How do I index individual text boxes in Access Continuous Form?

P: n/a
Im trying to get the name of a bound control on a continuous form in
Access. So that I can get the value of any text field.

This is what Im looking to do....

The user enters a value for number of entries for a specific month in
column1, column2 is the value for number of entries used Year to Date.
So I am looking to calculate column2 with the value of the current
column1 plus the value of the previous records column2.

Confused yet?

Example...

Col1 Col2
------------------------------------
5 5
2 7
3 10
5 15

so user enters.... 4 for next record in col1 hence col2 should be
calculated to 19. I attempted to code a work around which when the
user lost focus on col1 I went move previous on the recordset, store
the value of col2 in a temp variable, movenext again, so that Im back
to the original record, then set col2 = col1 + temp variable. This
kinda works but is messy.

I'd be able to do this in VB or something if the text box fields were
a control array or whatever.

Any help on this would be most appreciated.
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I didn't think it was possible, but I think I have cracked it.

Assiming the table is called Table1 and has a field ID which is an
autonumber, and a Numeric Field called Col1

Create a continuous form with ID & Col1 bound to the table. This must be
bound to a table or query where the ID is in ascending order.
Create a textbox called Col2
the Control Source of Col2 is =IIf(Not
IsNull([Col1]),DSum("Col1","Table1","ID <= " & [ID]))

You also have to save the record after updateing Col1 with and requery Col2

Private Sub Col1_AfterUpdate()

DoCmd.RunCommand acCmdSaveRecord
Col2.Requery

End Sub

and you have to requery Col2 after deleting a record from the form

Private Sub Form_AfterDelConfirm(Status As Integer)

Col2.Requery

End Sub

HTH

Phil

"D Boyd" <da*********@gmail.com> wrote in message
news:54**************************@posting.google.c om...
Im trying to get the name of a bound control on a continuous form in
Access. So that I can get the value of any text field.

This is what Im looking to do....

The user enters a value for number of entries for a specific month in
column1, column2 is the value for number of entries used Year to Date.
So I am looking to calculate column2 with the value of the current
column1 plus the value of the previous records column2.

Confused yet?

Example...

Col1 Col2
------------------------------------
5 5
2 7
3 10
5 15

so user enters.... 4 for next record in col1 hence col2 should be
calculated to 19. I attempted to code a work around which when the
user lost focus on col1 I went move previous on the recordset, store
the value of col2 in a temp variable, movenext again, so that Im back
to the original record, then set col2 = col1 + temp variable. This
kinda works but is messy.

I'd be able to do this in VB or something if the text box fields were
a control array or whatever.

Any help on this would be most appreciated.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.