Setting last modified date for text fields w/i a tab control

R

Rey

Howdy all.
Have a tab control w/6 tabs.

Desire to have a field in the last tab (Borrower Financial
Information) updated whenever any field gets updated in this tab only.

Tried at the form afterupdate event but that changes when ever a field
is saved in which ever tab use was at.

Also tried w/tab control, onchange but that just signals when tab was
changed...

Was just thinking to try the form afterupdate event in conjunction
with the tabcontrol page value/page name at which time i would have
LastModifiedDate.Value = Date
LastModifiedDate.Requery

Thanks in advance,
Rey
 
R

Rey

In the form_afterupdate event, entered the name of the tab control and
specific page value and following code and the last modified date
field was updated only if on that tab page. If on another tab, code
was stepped over but changes on that tab took effect.

Private Sub Form_AfterUpdate()
' update LastModidiedDate field when control on form or form is
saved
If Me.TabCntrol.Value = 5 Then
LastModifiedDate.Value = Date
LastModifiedDate.Requery
End If

Was this the correct way?

Thanks in advance,
Rey
 
J

John W. Vinson

Howdy all.
Have a tab control w/6 tabs.

Desire to have a field in the last tab (Borrower Financial
Information) updated whenever any field gets updated in this tab only.

The data is, of course, NOT stored or updated *in the tab*.

A Tab Control is *only* a way to manage screen real estate. The controls on a
tab control are, logically, on the Form and thus bound to that Form's
Recordsource. If there are Subforms on the tab pages, controls on the subform
are bound to their own recordsource tables.
Tried at the form afterupdate event but that changes when ever a field
is saved in which ever tab use was at.

Of course. Because the controls are on the form, and only visually on the tab.
Also tried w/tab control, onchange but that just signals when tab was
changed...

Was just thinking to try the form afterupdate event in conjunction
with the tabcontrol page value/page name at which time i would have
LastModifiedDate.Value = Date
LastModifiedDate.Requery

If you really want to do this, you'll need to have as many LastModifiedDate
fields stored *IN YOUR TABLE* as you have tab pages (since values just on the
form will not be stored or remembered); and you'll need to update them in the
afterupdate event of each textbox, combo box or other bound control on that
page.
 
R

Rey

The data is, of course, NOT stored or updated *in the tab*.

A Tab Control is *only* a way to manage screen real estate. The controls on a
tab control are, logically, on the Form and thus bound to that Form's
Recordsource. If there are Subforms on the tab pages, controls on the subform
are bound to their own recordsource tables.


Of course. Because the controls are on the form, and only visually on the tab.



If you really want to do this, you'll need to have as many LastModifiedDate
fields stored *IN YOUR TABLE* as you have tab pages (since values just on the
form will not be stored or remembered); and you'll need to update them in the
afterupdate event of each textbox, combo box or other bound control on that
page.

Thanks for replying, John. Apologies for not responding earlier.
In the end, just added an unbound field for user to manually update...
And I did not fully explain that I was using a table to hold the data
being viewed in the tab controls.

Thanks again,
Rey
 
J

John W. Vinson

In the end, just added an unbound field for user to manually update...

You're aware that this unbound control will be blank the next time the
database is opened, and that it will not have any relationship to any data in
the table?
 
R

Rey

You're aware that this unbound control will be blank the next time the
database is opened, and that it will not have any relationship to any datain
the table?

Sorry, guess I thinking about other things when I wrote this but I was
wrong in stating it was unbound as the lastModifedDate is a field in
the table.
If my head wasn't attached to my body, sometimes I think I wouldn't
realize I'd lost it...:cool:

Rey
 
J

John W. Vinson

Sorry, guess I thinking about other things when I wrote this but I was
wrong in stating it was unbound as the lastModifedDate is a field in
the table.


You can set the DefaultValue property of the form control - or the table field
- to Date() in order to have it filled in automatically without imposing on
the user.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top