Update a field.

frankbutcher

Registered User.
Local time
Today, 12:51
Joined
Aug 6, 2004
Messages
192
Hi
I have a form linked to a table (via a query) with a "diarydate" field. When I double clickon the field on the form, it opens a calendar, I double click on a date and it adds it into the field.
This works fine, but it will only add the date into the table once I go to the next record and then go back to the original record.
What I am trying to acheive , once I have added the date, is to run an Append Query to put the date into another table, but I can only do this once it has been added into the table.

I have tried Docmd.Save but this doesn't seem to work.
Docmd.Requery works, but then the form goes back to the 1st record, which mnay not be the one I am on.

Hope this makes sense.

Thanks.

Frank.
 
1. DoCmd.Save has nothing to do with records. It has to do with saving DESIGN CHANGES.

2. What is the code for the double click on the calendar which places the date in the control on the form? You can force a save of the form but before I can tell you the best code for that I have to know how the control is getting the date.
 
Many thanks for the quick reply.

frmCalendar was taken from a db from a thread a while back:-


Private Sub AXCalendar1_DblClick()
On Error Resume Next
Dim datRet As Date

datRet = Me.txtDate

DoCmd.Close acForm, Me.Name

Screen.ActiveControl = datRet


End Sub


Thanks.

Frank.
 
Sorry to have to do this but i need 10 posts to post links for some strange reason, hence the double post
 
Docmd.Requery works, but then the form goes back to the 1st record, which may not be the one I am on.
I, too, am having a problem following your scenario here and why the new date doesn't appear on the form until after the form is Requeried, but if Docmd.Requery works for you, here is the code that you need to Requery and then return to the record you were on before the Requery was performed:
Code:
Dim RecId As Integer

RecId = Me.CurrentRecord

Me.Requery

DoCmd.GoToRecord , , acGoTo, RecId

Simply replace the line

Docmd.Requery

with the above code.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom