Default Value

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

Guest

I asked this before but the answer didn't work.

I have a form with one row of fields - once all data is entered a new row
pops-up under it with the same fields. I am trying to get the "Last Name"
field to default to what was already entered in the previous row.
The fields are:
Date - Man Number - Last Name - Etc
The Last Name field gets it info from the "Man Number" field which is a
Combo Box. The expression below I have in my "Man Number" field AfterUpdate.
It does update the next rows "Man Number" but does not update the Last Name
field.

Private Sub Man_Number_AfterUpdate()
Me![Last Name] = Me.Man_Number.Column(1)
Me![Man Number].DefaultValue = "'" & Me![Man Number] & "'"
End Sub

Thanks
 
For Last Name, you are updating the current record vs setting the Default
value for the control. You should have:

Me![Last Name].DefaultValue = "'" & Me.Man_Number.Column(1) & "'"
 
Thanks - That works - Perfect....


Paul Overway said:
For Last Name, you are updating the current record vs setting the Default
value for the control. You should have:

Me![Last Name].DefaultValue = "'" & Me.Man_Number.Column(1) & "'"


--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


George said:
I asked this before but the answer didn't work.

I have a form with one row of fields - once all data is entered a new row
pops-up under it with the same fields. I am trying to get the "Last Name"
field to default to what was already entered in the previous row.
The fields are:
Date - Man Number - Last Name - Etc
The Last Name field gets it info from the "Man Number" field which is a
Combo Box. The expression below I have in my "Man Number" field
AfterUpdate.
It does update the next rows "Man Number" but does not update the Last
Name
field.

Private Sub Man_Number_AfterUpdate()
Me![Last Name] = Me.Man_Number.Column(1)
Me![Man Number].DefaultValue = "'" & Me![Man Number] & "'"
End Sub

Thanks
 
Back
Top