Autofill from previous record

  • Thread starter Thread starter jjosephmn
  • Start date Start date
J

jjosephmn

Attempted to preform steps to autofill from KB article #210236
http://support.microsoft.com/default.aspx?scid=KB;EN-US;210236
Only thing different I entered is on step 5 I used Support instead of
Customer because thats the form I am attempting to add this autofill
function. Also I am adding this directly into the ONCurrent line and
not into the [EventPrecedure]using Visual Basic (that didnt work
either). When I start a new record I get

Compiler Error
User-defined type not defined

It seems to point at this part of the code.
1.The first line is highlighted in Yellow
Function AutoFillNewRecord(F As Form)

2. This part of the second line is highlighted in blue
RS As DAO.Recordset

Here is the first part of the code

Function AutoFillNewRecord(F As Form)

Dim RS As DAO.Recordset, C As Control
Dim FillFields As String, FillAllFields As Integer

On Error Resume Next

' Exit if not on the new record.
If Not F.NewRecord Then Exit Function

Please help I've had no success.
TIA
 
assuming that you're using Access 2000, did you follow the directions in the
NOTE: in the article, as

"NOTE: The sample code in this article uses Microsoft Data Access Objects.
For this code to run properly, you must reference the Microsoft DAO 3.6
Object Library. To do so, click References on the Tools menu in the Visual
Basic Editor, and make sure that the Microsoft DAO 3.6 Object Library check
box is selected."

hth
 
Thank you so much Tina that did the trick. One thing I have it set up to
only autofill certain controls but it seems to autofill all controls. Any
hints. I think I came across this problem in past post, I'll look into that.
Thanks once again

tina said:
assuming that you're using Access 2000, did you follow the directions in the
NOTE: in the article, as

"NOTE: The sample code in this article uses Microsoft Data Access Objects.
For this code to run properly, you must reference the Microsoft DAO 3.6
Object Library. To do so, click References on the Tools menu in the Visual
Basic Editor, and make sure that the Microsoft DAO 3.6 Object Library check
box is selected."

hth


Attempted to preform steps to autofill from KB article #210236
http://support.microsoft.com/default.aspx?scid=KB;EN-US;210236
Only thing different I entered is on step 5 I used Support instead of
Customer because thats the form I am attempting to add this autofill
function. Also I am adding this directly into the ONCurrent line and
not into the [EventPrecedure]using Visual Basic (that didnt work
either). When I start a new record I get

Compiler Error
User-defined type not defined

It seems to point at this part of the code.
1.The first line is highlighted in Yellow
Function AutoFillNewRecord(F As Form)

2. This part of the second line is highlighted in blue
RS As DAO.Recordset

Here is the first part of the code

Function AutoFillNewRecord(F As Form)

Dim RS As DAO.Recordset, C As Control
Dim FillFields As String, FillAllFields As Integer

On Error Resume Next

' Exit if not on the new record.
If Not F.NewRecord Then Exit Function

Please help I've had no success.
TIA
 
well, the code is pretty straightforward. if you followed the setup
directions to allow it to autofill only certain fields, and it's not working
as described, then i can only suggest you double-check your setup against
the instructions. if you don't find any errors in your setup, you might try
stepping through the code on execution, so you can see exactly what is
happening.

hth


Johnjmn said:
Thank you so much Tina that did the trick. One thing I have it set up to
only autofill certain controls but it seems to autofill all controls. Any
hints. I think I came across this problem in past post, I'll look into that.
Thanks once again

tina said:
assuming that you're using Access 2000, did you follow the directions in the
NOTE: in the article, as

"NOTE: The sample code in this article uses Microsoft Data Access Objects.
For this code to run properly, you must reference the Microsoft DAO 3.6
Object Library. To do so, click References on the Tools menu in the Visual
Basic Editor, and make sure that the Microsoft DAO 3.6 Object Library check
box is selected."

hth


Attempted to preform steps to autofill from KB article #210236
http://support.microsoft.com/default.aspx?scid=KB;EN-US;210236
Only thing different I entered is on step 5 I used Support instead of
Customer because thats the form I am attempting to add this autofill
function. Also I am adding this directly into the ONCurrent line and
not into the [EventPrecedure]using Visual Basic (that didnt work
either). When I start a new record I get

Compiler Error
User-defined type not defined

It seems to point at this part of the code.
1.The first line is highlighted in Yellow
Function AutoFillNewRecord(F As Form)

2. This part of the second line is highlighted in blue
RS As DAO.Recordset

Here is the first part of the code

Function AutoFillNewRecord(F As Form)

Dim RS As DAO.Recordset, C As Control
Dim FillFields As String, FillAllFields As Integer

On Error Resume Next

' Exit if not on the new record.
If Not F.NewRecord Then Exit Function

Please help I've had no success.
TIA
 
Back
Top