Updating the default values

  • Thread starter Thread starter trini007
  • Start date Start date
T

trini007

I need a script to automatically update defalut values in a form...s
that when a change is made, that change is now the default value fo
new records.

Please hel
 
Not sure, but maybe this will do the trick...

Code
-------------------

Private Sub YourTextBox_AfterUpdate()

Me.YourTextBox.DefaultValue = Me.YourTextBox
DoCmd.RunCommand acCmdSaveRecord

End Sub
 
Hey, I one more problem with default values...when using text values i
doesn't show in the form, it saves correctly in the table but in th
form displays as...#Name?...i know its because there isn't an
quotes... Is there anyway to get around this problem
 
trini007 said:
Hey, I one more problem with default values...when using text values it
doesn't show in the form, it saves correctly in the table but in the
form displays as...#Name?...i know its because there isn't any
quotes...

Add rhe quotes:

Me.YourTextBox.DefaultValue = """" & Me.YourTextBox & """"
 
Back
Top