Updating a Tabluar Form

PRD

Registered User.
Local time
Today, 09:55
Joined
May 18, 2011
Messages
72
Hello, I created a Tabular Form (called TabRecordForm) which consists of seven columns of data. I locked the last six columns so that the only column the user can modify is a check-box field in the first column. The idea is the user checks the records he wants to display and then clicks a command button to view them in detail.


The problem I am having is that if the user checks four boxes only the first three records are displayed (because the fourth record’s check-box never gets updated). I get around this by closing the Tabular Form (to update the last record) and then immediately re-open it. This works fine but it looks rather funky to see the form momentarily disappear and then reappear.


So my question is, is there a way I can update all of the records on the Tabular Form without actually closing (and re-opening) it?


I saw that there is a Form.Requery and Form.Refresh statement but I cannot seem to get them to work. Do these statements work with Tabular Forms? Thank you for your time.
 
Sounds like you just need to save the record when the form closes:

DoCmd.RunCommand acCmdSaveRecord
 
Ken -

Interesting, I am still learning Access so please bear with me. I am trying to avoid closing the Form, will this command work if I keep the Form open? Also, the Form lists about 25 records, how will it know which record to save?

I will give this a try and let you know what happens. Thx.
 
Ken's suggestion that you save the record will work without closing the form.

There is never more than one unsaved record at any time. Records on a bound form are saved when the focus is moved to another record or the form is closed.
 
...There is never more than one unsaved record at any time.
And so the Command Ken gave will save the Current Record. FYI, this is usually referred to as explicitly saving the Record or forcing a save.

Linq ;0)>
 
Thank you all for your help and info. The SaveRecord command worked perfectly and I was even able to insert the command into the Macro which opens the DetailRecordForm (so I did not even have to write a VB program).

Also, FYI, I did get the Form.Requery command to work. I was originally coding the statement:

TabRecordForm.Requery or [Form]![TabRecordForm].Requery

which did not work. Instead if I coded:

("TabRecordForm").Requery

it worked fine. Thanks again for your input.
 
Glad you have it working :)

And thanks for sharing your solution...
 
Actually, the simplest way to get the current open form to Requery, from its code module, is simply Me.Requery!

The Me construct is a kind of shorthand referring to the code module's Form, negating the need to use the lengthier full reference to it.

Like Ken, I'm happy you got this working!

Linq ;0)>
 
missinglinq -

Thanks for the tip. I am an old COBOL programmer from the 90's and always appreciate a good tip or trick. I am constantly amazed at how versatile and robust Access is. My next task is to link each detail record to a jpg photo. I have some ideas I want to try but if they don't pan out I may be back for some guidance. Thx.
 

Users who are viewing this thread

Back
Top Bottom