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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Current Event, Access 2000

Status
Not open for further replies.

Spyrios

Technical User
Jan 24, 2004
22
US
Does anyone know if there is any reason why this code would work just fine in Access XP but not in Access 2000?

Private Sub Form_Current()
Dim myTime
Dim SDate

myTime = Time
SDate = Date



Me![Worked Date].Value = SDate
Me![WhenCalled].Value = myTime
Me![User].Value = Environ("username")
Me![Grabbed].Value = -1

End Sub
 
Actually, let revise what I just stated.. It does work (as soon as I linked the on current event on the form to the code,, duh). But here's the problem. The form's record source is an updatable query. These fields that are populated by the vba code are hidden, but very crucial to the user getting the right record. So all I need it to do is populate with the on current event, and then write that data into the record immediately. In Access XP this does happen. In Access 2000, well, it populates the fields (which do have the query fields as their record source) but it does not move the data into the record. What gets me is that I developed this at home, and it worked like a charm. I sent the database to work, and it went bang. Thanks for any help.


Michael
 
Try issuing some kind of save command (some samples)

[tt]Me.Refresh
Me.Requery
docmd.runcommand accmdsaverecord[/tt]


Roy-Vidar
 
Thanks a bunch. I was just coming in to cancel my post... I pulled it up on my laptop and what do you know, me.requery is there. Sorry, I was just frantic when it didn't work.


but between these three, what is the difference? Do they all do the same thing with a slight variance?
 
Don't want to answer;-)

There's a know flaw in most versions of Access, Losing data when you close a form I'd consider Allen Browne's tips here, where he also describes some of the differences between different methods of saving.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top