> My dbase has a form with a subform. In the subform you enter the
> beginning
[quoted text clipped - 5 lines]
> field
> for the current month?
I tried the code you mentioned and nothing happened. Below is what I entered
in the AfterUpdate event within the Ending Mileage field of the subform:
Private Sub Ending_Mileage_AfterUpdate()
Me!Beginning Mileage.DefaultValue = Me!Ending Mileage
End Sub
The middle line of this code stayed red. I took the space out between both
beginning mileage and ending mileage and the line went back to normal black
but the code still didn't work. I checked the table where the fields are
stored and the two mileage fields are spelled exactly as in the above code.
Any suggestions?

Signature
Todd
> Assuming the beginning mileage field on your form is named BeginningMileage
> and the ending mileage field is named EndingMileage, put the following code
[quoted text clipped - 15 lines]
> > field
> > for the current month?
Douglas J. Steele - 10 Jul 2007 15:36 GMT
Because your field names have spaces in them (seldom a good idea, btw), you
need to enclose them in square brackets. And even if the field is numeric,
the DefaultValue property is text, and so want quotes:
Me![Beginning Mileage].DefaultValue = Chr$(34) & Me![Ending Mileage] &
Chr$(34)

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
>I tried the code you mentioned and nothing happened. Below is what I
>entered
[quoted text clipped - 36 lines]
>> > field
>> > for the current month?
Steve - 10 Jul 2007 17:06 GMT
Ending_Mileage indicates that the field name on your form is Ending_Mileage
with an underline and no space between the words. Open
your form in design view and select the Beginning Mileage field. Open
properties and go to the Other tab. Is the name of this field
Beginning_Mileage? Also, Doug is right about the quotes. Your line of code
should be:
Me!Beginning_Mileage.DefaultValue = Chr$(34) & Me!Ending_Mileage & Chr$(34)
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com
>I tried the code you mentioned and nothing happened. Below is what I
>entered
[quoted text clipped - 36 lines]
>> > field
>> > for the current month?
Douglas J. Steele - 10 Jul 2007 19:16 GMT
> Ending_Mileage indicates that the field name on your form is
> Ending_Mileage
> with an underline and no space between the words.
No, it doesn't necessarily mean that. If the field is named Ending Mileage
(with a space), the procedure generated for the field will be:
Private Sub Ending_Mileage_AfterUpdate()
(Try it and see)

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Ending_Mileage indicates that the field name on your form is
> Ending_Mileage
[quoted text clipped - 52 lines]
>>> > field
>>> > for the current month?
Todd - 10 Jul 2007 20:08 GMT
Here is what I have now in the AfterUpdate event of the Ending Mileage field.
Private Sub Ending_Mileage_AfterUpdate()
Me![Beginning Mileage].DefaultValue = Chr$(34) & Me![Ending Mileage] &
Chr$(34)
End Sub
It appears the code is accurate because it's not red anymore but the result
is the same, nothing happens when I select a new record to add.
Am I correct in saying what should happen with this code is when I select a
new record for the next month on a vehicle, the Beginning Mileage will
automatically populate with the most recent ending mileage entered? This
is the way I hoped it would work. Sorry for the trouble!

Signature
Todd
> > Ending_Mileage indicates that the field name on your form is
> > Ending_Mileage
[quoted text clipped - 63 lines]
> >>> > field
> >>> > for the current month?
Douglas J. Steele - 11 Jul 2007 00:57 GMT
Check that you haven't defined a default value (usually 0) for the field in
the table.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Here is what I have now in the AfterUpdate event of the Ending Mileage
> field.
[quoted text clipped - 89 lines]
>> >>> > field
>> >>> > for the current month?
Steve - 11 Jul 2007 15:53 GMT
Doesn't a field default value in a form override the default value in the
table?
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com
> Check that you haven't defined a default value (usually 0) for the field
> in the table.
[quoted text clipped - 93 lines]
>>> >>> > field
>>> >>> > for the current month?
Todd - 11 Jul 2007 20:06 GMT
I checked and there is no default value in the beginning mileage or ending
mileage fields within the form or table fields. The data type in the table
for both fields is Number, the field size is Long Integer, the format is
Standard, decimal places is 0, Required is No, and Indexed is No in case this
helps.

Signature
Todd
> Check that you haven't defined a default value (usually 0) for the field in
> the table.
[quoted text clipped - 92 lines]
> >> >>> > field
> >> >>> > for the current month?
Douglas J. Steele - 14 Jul 2007 19:44 GMT
Sorry, no idea why it's not working for you.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
>I checked and there is no default value in the beginning mileage or ending
> mileage fields within the form or table fields. The data type in the
[quoted text clipped - 112 lines]
>> >> >>> > field
>> >> >>> > for the current month?