Copying form fields into a new record.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I pretty much want to be able to do what
http://support.microsoft.com/default.aspx?scid=kb;en-us;210236 talks about,
except I can't configure the code right. This is about the second time I've
done anythign in VB so I'm probably missing something blatantly obvious here.

I created the Module as per the instructions, and into the On Load of my
"Add/Edit Hardware Form" form I put;
Me.OnCurrent = AutoFillNewRecord([Forms]![Add/Edit Hardware Form])

I have an invisible text box in my form called; AutoFillNewRecordFields

The Error is a compile Error - user defined type no defined. It's referring
to "RS As DAO.Recordset" on the second line of the module.


I'm pretty lost since I have no experience in VB and not much time to learn
it. If someone could help me with what I need to define and where I would
appreciate it greatly.
 
Maybe this would work instead? But it throws an error too.

Private Sub Form_Current()
If Me.NewRecord = True Then
Dim rsClone As Recordset
Set rsClone = Me.RecordsetClone
rsClone.MoveLast
Me!FirstName = rsClone!FirstName
Set rsClone = Nothing
End If
End Sub
 
Back
Top