Update subform based on field (1 Viewer)

Ellie1326

New member
Local time
Today, 07:11
Joined
Aug 31, 2012
Messages
3
I am confused - I am trying to get the query that is in my subform to update automatically based on information I enter into a field in the form. It is linked to the query, but only updates when I get out of that record and come back into it, not immediately after I enter this information in the field. How do I get this to update immediately? I have googled this all day and cannot figure it out. None of the recommendations seem to work, so I'm sure I'm missing something simple but cannot figure out what it is! Help! :banghead:

Thanks
 

vbaInet

AWF VIP
Local time
Today, 12:11
Joined
Jan 22, 2010
Messages
26,374
You will need to force save the entire record if you want immediate updates to the underlying table.

DoCmd.RunCommand accmdrecordsave

That will save your record each time you update a field. But it's obviously not recommended.
 

vbaInet

AWF VIP
Local time
Today, 12:11
Joined
Jan 22, 2010
Messages
26,374
I just noticed I typed that wrong, it should be accmdsaverecord and not accmdrecordsave
 

Ellie1326

New member
Local time
Today, 07:11
Joined
Aug 31, 2012
Messages
3
Why would it be a bad thing to save the records each time you update a field? They can still be updated immediately thereafter, right? Sorry for my ignorance, I'm just now starting to learn this 'side' of Access; the database that I'm creating is really the first one that I've worked in other than just data entry.
 

vbaInet

AWF VIP
Local time
Today, 12:11
Joined
Jan 22, 2010
Messages
26,374
I didn't say it's a bad thing, it's just not recommended. Think about it, you're bouncing back and forth to the db whenever you update a field and consider what effect it will have on your db if you had multiple users doing the same thing.

I didn't even say welcome to the forum. :)
 

MightyCat

Registered User.
Local time
Today, 04:11
Joined
Sep 11, 2012
Messages
17
So what is the event that you would put the accmdrecordsave in? I'm assuming, if I had a form, and the form had multiple fields to enter information, upon leaving the record, it should run an update query or the referenced command but would event would that be under? And if its a subform, would it be the main form? or the subform itself?

I have a form with a datasheet and a subform below it that runs off the same linked table. So, right now, you need to click another record in the datasheet to move the record in the subform below it.

Soes that make sense?
 

Users who are viewing this thread

Top Bottom