Acces tables - help me!

Message Bookmarked
Bookmark Removed
In access 200, I have a textbox bound to a table. I need the table to update AS SOON as the value in the form changes. Anyone know if there's a bit of code that refreshes the tables and records and means I don't have to exit the form or anything?

Johnney B (Johnney B), Thursday, 31 March 2005 10:55 (twenty-one years ago)

Er... yeah, I forget the actual mechanics but I know that you can trigger an event "on update". However, unfortunately, Access often doesn't register the field updated until you have actually left the field or saved the record.

Masonic Cathedral (kate), Thursday, 31 March 2005 10:58 (twenty-one years ago)

An inelegant but workable method to overcome the udate proble is to run code or a macro from "on exit" of a field (or from a command button) to "goto next(or previous)record" and then "goto previous (or next) record". This should update the underlying table.

at work logged out, Thursday, 31 March 2005 11:23 (twenty-one years ago)

An "on exit" macro just to "save record" should have the same effect.

(Am having trouble remembering the names of these procedures as I've been working so much on Excel (feh) and ACT (double feh) so much lately.)

Masonic Cathedral (kate), Thursday, 31 March 2005 11:26 (twenty-one years ago)

figure out when you want to refresh, and add

textboxname.requery

to the code?

ken c (ken c), Thursday, 31 March 2005 11:32 (twenty-one years ago)

oh wait forget that, i see what you mean now.

ken c (ken c), Thursday, 31 March 2005 11:34 (twenty-one years ago)

yes, use the afterupdate event, and add the save macro on there.

if you create a save record button access would generate the code for you but the main jist of it is


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

(i'm using access 2002 so the code may be different.. )

ken c (ken c), Thursday, 31 March 2005 11:37 (twenty-one years ago)

Ah, nice one Ken. I knew one of you clever fellows would know! Thanks to you all, mind.

Poor Kate stuck in Excel!

Johnney B (Johnney B), Thursday, 31 March 2005 12:01 (twenty-one years ago)

I was *hired* for this job as an Access whiz. And all they've had me do so far is Excel gruntwork. They keep *promising* me Access stuff, but I've only done one or two little simple things in Access. Tomorrow I am having a meeting to design my first proper Big Access Project, though! Wish me luck!

Masonic Cathedral (kate), Thursday, 31 March 2005 12:08 (twenty-one years ago)

It's the boring gruntwork that give syou ILX time. Big Access Project = busy Kate = oh no! no more Kate on ILX oh no!

Johnney B (Johnney B), Thursday, 31 March 2005 12:22 (twenty-one years ago)

I love your assessment of my career path there, Johnney... :-)

Masonic Cathedral (kate), Thursday, 31 March 2005 12:26 (twenty-one years ago)

also .. excel macros are way more fun than access macros!!

ken c (ken c), Thursday, 31 March 2005 12:53 (twenty-one years ago)

Yeah, we have excel macros enabled on this network, which I didn't on the last network I worked on.

Masonic Cathedral (kate), Thursday, 31 March 2005 12:54 (twenty-one years ago)

Excel macros = fun fun fun till daddy takes your privileges away

Access macros = for people who can't be bothered to learn VBA.

Johnney B (Johnney B), Thursday, 31 March 2005 12:56 (twenty-one years ago)

So true, oh so true...

Masonic Cathedral (kate), Thursday, 31 March 2005 12:59 (twenty-one years ago)

u people r nutz

wot oh wot r u talking about

i just wrote my first form in html it took me 10000 hrs
:(

ambrose (ambrose), Thursday, 31 March 2005 16:13 (twenty-one years ago)


You must be logged in to post. Please either login here, or if you are not registered, you may register here.