简体   繁体   中英

Updating specifics rows in a RecordSource of a Sub-Form by using textbox


I am on Office Access 2007, i've been working on a Race Timer for school during vacations. I already know that Access is not the best for this sort of software but the previous developer been using this..

So here's the problem.
I've got a form, which contain a sub-form. That sub-form have a RecordSource, that is generating lines in the body/mid(?) section of the sub-form. Each fields are put in a textbox exept the name.
I want to change for instance the second row, by modifying the textbox related to it and clicking on a button i placed in the footer section to update the Table connected to the RecordSource.

But i have no idea how i can know with programmation how to access to the textbox of the the third row, cause they have same name?

Best Regards

I can mail you an image of what it looks like if needed (i am under 10 reputations so no images : / )

It's a bit difficult to understand exactly what you are looking for, but you could likely do the following;

Dim dbCurr As DAO.Database
Dim rst As DAO.Recordset
Set dbCurr = CurrentDb
Set rst = dbCurr.OpenRecordset("NameOfTableRecordsetIsReferencing")

With rst
.Edit
!ContactName = txtName ..........' This can be any field in your table
.Update
End With

rst.Close
dbCurr.Close

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM