I am using the follow code to repeat a field value in a new record so it does not have to be automatically entered.
On some of my databases I get a type mismatch error and the only diffence I can find is in the databases where I get this error I notice they are set with a GUID indesing and did read something about DAO ADO databases. I am new and do not know what that means or how some of my databases are set up with this and some are not. Does anyone have any ideas how I can get around this problem.
Code:
Public Sub cmdRecordAdd_Click()
DoCmd.GoToRecord , , acNewRec
Dim RstDup As Recordset
' Gets duplicate copy of current recordset to use
Set RstDup = Me.RecordsetClone
' Moves to the last record in the set , being the last entered to get the data for the new form
RstDup.MoveLast
' Sets the information from fields from last record into current record, put each field you want duplicated in this list
Me![ClientNo] = RstDup![ClientNo]
'Closes the cloned recordset
RstDup.Close
Set RstDup = Nothing
End Sub
Comment