Remembering and prefilling new record with last combobox selection

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

Guest

I have a field called [company] on a continuous form. There are three
drop-down options in this field (in a combobox). All records will have the
same value until the next time the form is opened. And all new records
created HAVE to have the same [company] value as the rest.

Below is my code that is on the 'OnLoad' event for the form
[AccountingDetailsForm], but this only works for text fields. What needs to
change for a combobox selection?

Me.Company.DefaultValue = """" & Me.Company.Value & """"
 
I tried that before and that didn't work. When I open the form the company
field shows '#Name?'.

This field doesn't have a key ID number so the selections are stored as
text, which is why I thought I would need the """. What am I missing?

Ofer said:
Try this, remove the quote

Me.Company.DefaultValue = Me.Company.Value
--
I hope that helped
Good luck


BLTibbs said:
I have a field called [company] on a continuous form. There are three
drop-down options in this field (in a combobox). All records will have the
same value until the next time the form is opened. And all new records
created HAVE to have the same [company] value as the rest.

Below is my code that is on the 'OnLoad' event for the form
[AccountingDetailsForm], but this only works for text fields. What needs to
change for a combobox selection?

Me.Company.DefaultValue = """" & Me.Company.Value & """"
 
Back
Top