Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / May 2007

Tip: Looking for answers? Try searching our database.

Refreshing an Object Field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jasmine - 30 May 2007 21:00 GMT
In a form, when I Insert a new Record I want to update  the REVCD Field
with today's date.
At the same time I want to refresh the RECVDTE with the information.
What is the syntax code for this procedure?

I have tried the code below but the only time the record gets update is if i
move out of the current record.
I want to remain on the current record but refresh the RECVDTE Field.

the code I have is ( which for some reason is not updating that field -
unless i move to another record)

Private Sub Form_AfterInsert()
  Me.RECVDTE = Date

[Forms]![INFORMAL]![CASE SUBFORM]![MEDREQ SUBFORM5]![RECVDTE].Refresh

End Sub
KARL DEWEY - 30 May 2007 22:30 GMT
Just open the table in design view, click on menu VIEW - Properties.  Set the
default to     =Date()  and any new records will contain the current date.  
If you use   =Now() it will include the time.
Signature

KARL DEWEY
Build a little - Test a little

> In a form, when I Insert a new Record I want to update  the REVCD Field
> with today's date.
[quoted text clipped - 14 lines]
>
> End Sub
John W. Vinson - 30 May 2007 23:55 GMT
>In a form, when I Insert a new Record I want to update  the REVCD Field
>with today's date.

Just set its DefaultValue property to Date(). I don't think you need any code
at all!

>At the same time I want to refresh the RECVDTE with the information.
>What is the syntax code for this procedure?

What is RECVDTE and how does it relate to REVCD? Is RECVDTE a textbox or other
control, bound to REVCD, or what?

>I have tried the code below but the only time the record gets update is if i
>move out of the current record.

The AfterInsert event only fires... ummm... *after* the insert, when all the
fields have been filled in and something is done to actually write the record
to disk. Typical "somethings" that do so are moving off the record, closing
the form, setting focus to a subform, etc.

>I want to remain on the current record but refresh the RECVDTE Field.

>the code I have is ( which for some reason is not updating that field -
>unless i move to another record)
[quoted text clipped - 3 lines]
>
> [Forms]![INFORMAL]![CASE SUBFORM]![MEDREQ SUBFORM5]![RECVDTE].Refresh

Just setting the value will change the display. A separate Refresh is not
needed.

            John W. Vinson [MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.