Movian
03-20-2009, 08:55 AM
A while ago i made a post about automaticly saving information from the form to the table.
i did get a solution but there were some downsides to my aproach in that it would cause random focus changes.
i am now review the code and have opted to take the following aproach
Dim mydb As DAO.Database
Dim myrs As DAO.Recordset
Set mydb = CurrentDb
Set myrs = mydb.OpenRecordset("Settings")
If myrs.Fields("AutoSave") = True Then
Me.Dirty = False
Forms("frmMain").Controls("fsubmodule").Form.isdirty
End If
myrs.Close
Set myrs = Nothing
mydb.Close
Set mydb = Nothing
The problem is, that when the event ocurs and say a person is typing in a field. it will highlight all the text in the field so when they press the next key it deletes the information.
What would i need to do to A) Ensure that if we enter a new record then without closing the form. go to another machine we will be able to see that record. and B) ensure that the saving proceudre does not affect data entry at the same time it is being saved.
any help would be helpfull on this as i am on a time limit and i have spent hours on this today allready :bug:
EDIT~ infact another interesting thing that ocurs is that sometimes when the autosave procuedre runs while someone is tuping text. The text will disapear untill you set focus on another control.
i did get a solution but there were some downsides to my aproach in that it would cause random focus changes.
i am now review the code and have opted to take the following aproach
Dim mydb As DAO.Database
Dim myrs As DAO.Recordset
Set mydb = CurrentDb
Set myrs = mydb.OpenRecordset("Settings")
If myrs.Fields("AutoSave") = True Then
Me.Dirty = False
Forms("frmMain").Controls("fsubmodule").Form.isdirty
End If
myrs.Close
Set myrs = Nothing
mydb.Close
Set mydb = Nothing
The problem is, that when the event ocurs and say a person is typing in a field. it will highlight all the text in the field so when they press the next key it deletes the information.
What would i need to do to A) Ensure that if we enter a new record then without closing the form. go to another machine we will be able to see that record. and B) ensure that the saving proceudre does not affect data entry at the same time it is being saved.
any help would be helpfull on this as i am on a time limit and i have spent hours on this today allready :bug:
EDIT~ infact another interesting thing that ocurs is that sometimes when the autosave procuedre runs while someone is tuping text. The text will disapear untill you set focus on another control.