Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AfterInsert want to insert a value into a field on the current record

Status
Not open for further replies.

twomblml

IS-IT--Management
Apr 17, 2001
42
0
0
US
Should be easy enough, it was working at one point in time but I changed some things around and its not working. I am trying to insert a value into a text field on the current record on the AfterInsert event of a form and it is not working properly. I have tried adding the field to the form and hidding it and then using:

me.textfield = "a"

method but this is not working. I see it on the form but it never saves the value to the record in the table. Any ideas on how I could do this?

Thanks!
 
Is textfield bound to the table ?
Why not using the BeforeInsert event instead of the AfterInsert ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes it is bound to the table. I want to do the AfterInsert because I need the value of an autonumber field to concatenate with another value to make up this text field. So I need to know the value of the autonumber field for that record before I can insert the value of my new field.

Thanks
 
I have even tried using a recordset in the afterinsert event and its not saving the value when I click on Close or Save.

Dim db As DAO.Database, rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tblbidders", dbOpenDynaset)

rs.Edit
rs![test_key] = "u"
rs.Update

What am I doing wrong?

Any help will be greatly appreciated.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top