Refreshing an Object Field

J

Jasmine

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
 
G

Guest

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.
 
J

John W. Vinson

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)

Private Sub Form_AfterInsert()
Me.RECVDTE = Date

[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]
 

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